Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1de9615

Browse files
committed
Use separate SQLSTATE codes for file not found/file exists, rather than
lumping them into ERRCODE_UNDEFINED_OBJECT/ERRCODE_DUPLICATE_OBJECT.This seems reasonable since 'object' was meant to refer to 'object in thedatabase' and a file is outside the database. Per request from DaveCramer.
1 parent0b511f0 commit1de9615

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

‎src/backend/utils/error/elog.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
*
3838
*
3939
* IDENTIFICATION
40-
* $Header: /cvsroot/pgsql/src/backend/utils/error/elog.c,v 1.119 2003/08/08 21:42:11 momjian Exp $
40+
* $Header: /cvsroot/pgsql/src/backend/utils/error/elog.c,v 1.120 2003/08/26 21:15:27 tgl Exp $
4141
*
4242
*-------------------------------------------------------------------------
4343
*/
@@ -530,20 +530,20 @@ errcode_for_file_access(void)
530530
edata->sqlerrcode=ERRCODE_INSUFFICIENT_PRIVILEGE;
531531
break;
532532

533-
/*Object not found */
533+
/*File not found */
534534
caseENOENT:/* No such file or directory */
535-
edata->sqlerrcode=ERRCODE_UNDEFINED_OBJECT;
535+
edata->sqlerrcode=ERRCODE_UNDEFINED_FILE;
536536
break;
537537

538-
/* Duplicateobject */
538+
/* Duplicatefile */
539539
caseEEXIST:/* File exists */
540-
edata->sqlerrcode=ERRCODE_DUPLICATE_OBJECT;
540+
edata->sqlerrcode=ERRCODE_DUPLICATE_FILE;
541541
break;
542542

543543
/* Wrong object type or state */
544544
caseENOTDIR:/* Not a directory */
545545
caseEISDIR:/* Is a directory */
546-
caseENOTEMPTY:/* Directory not empty */
546+
caseENOTEMPTY:/* Directory not empty */
547547
edata->sqlerrcode=ERRCODE_WRONG_OBJECT_TYPE;
548548
break;
549549

‎src/include/utils/errcodes.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*
1212
* Copyright (c) 2003, PostgreSQL Global Development Group
1313
*
14-
* $Id: errcodes.h,v 1.4 2003/08/04 00:43:32 momjian Exp $
14+
* $Id: errcodes.h,v 1.5 2003/08/26 21:15:27 tgl Exp $
1515
*
1616
*-------------------------------------------------------------------------
1717
*/
@@ -294,6 +294,8 @@
294294
/* Class 58 - System Error (class borrowed from DB2) */
295295
/* (we define this as errors external to PostgreSQL itself) */
296296
#defineERRCODE_IO_ERRORMAKE_SQLSTATE('5','8', '0','3','0')
297+
#defineERRCODE_UNDEFINED_FILEMAKE_SQLSTATE('5','8', 'P','0','1')
298+
#defineERRCODE_DUPLICATE_FILEMAKE_SQLSTATE('5','8', 'P','0','2')
297299

298300
/* Class F0 - Configuration File Error (PostgreSQL-specific error class) */
299301
#defineERRCODE_CONFIG_FILE_ERRORMAKE_SQLSTATE('F','0', '0','0','0')

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp