mirror of
https://github.com/postgres/postgres.git
synced 2025-07-15 19:21:59 +03:00
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 the database' and a file is outside the database. Per request from Dave Cramer.
This commit is contained in:
@ -37,7 +37,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/error/elog.c,v 1.119 2003/08/08 21:42:11 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/error/elog.c,v 1.120 2003/08/26 21:15:27 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -530,20 +530,20 @@ errcode_for_file_access(void)
|
||||
edata->sqlerrcode = ERRCODE_INSUFFICIENT_PRIVILEGE;
|
||||
break;
|
||||
|
||||
/* Object not found */
|
||||
/* File not found */
|
||||
case ENOENT: /* No such file or directory */
|
||||
edata->sqlerrcode = ERRCODE_UNDEFINED_OBJECT;
|
||||
edata->sqlerrcode = ERRCODE_UNDEFINED_FILE;
|
||||
break;
|
||||
|
||||
/* Duplicate object */
|
||||
/* Duplicate file */
|
||||
case EEXIST: /* File exists */
|
||||
edata->sqlerrcode = ERRCODE_DUPLICATE_OBJECT;
|
||||
edata->sqlerrcode = ERRCODE_DUPLICATE_FILE;
|
||||
break;
|
||||
|
||||
/* Wrong object type or state */
|
||||
case ENOTDIR: /* Not a directory */
|
||||
case EISDIR: /* Is a directory */
|
||||
case ENOTEMPTY: /* Directory not empty */
|
||||
case ENOTEMPTY: /* Directory not empty */
|
||||
edata->sqlerrcode = ERRCODE_WRONG_OBJECT_TYPE;
|
||||
break;
|
||||
|
||||
|
Reference in New Issue
Block a user