diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 2002-04-27 03:45:03 +0000 |
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 2002-04-27 03:45:03 +0000 |
| commit | 31c775adeb2251a9c66328cbc9016877e5e4f085 (patch) | |
| tree | 065014ccecaae449f8a1c977319e823d54364c4b /src/backend/commands/copy.c | |
| parent | aafe72efb2d9a01db77bacf94b9b103042b5eb60 (diff) | |
| download | postgresql-31c775adeb2251a9c66328cbc9016877e5e4f085.tar.gz | |
Restructure aclcheck error reporting to make permission-failure
messages more uniform and internationalizable: the global array
aclcheck_error_strings[] is gone in favor of a subroutine
aclcheck_error(). Partial implementation of namespace-related
permission checks --- not all done yet.
Diffstat (limited to 'src/backend/commands/copy.c')
| -rw-r--r-- | src/backend/commands/copy.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/backend/commands/copy.c b/src/backend/commands/copy.c index 45e108027f..1ab3ae14fc 100644 --- a/src/backend/commands/copy.c +++ b/src/backend/commands/copy.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.152 2002/03/29 19:06:05 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.153 2002/04/27 03:45:00 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -266,8 +266,8 @@ DoCopy(const RangeVar *relation, bool binary, bool oids, bool from, bool pipe, { FILE *fp; Relation rel; - const AclMode required_access = (from ? ACL_INSERT : ACL_SELECT); - int32 aclresult; + AclMode required_access = (from ? ACL_INSERT : ACL_SELECT); + AclResult aclresult; /* * Open and lock the relation, using the appropriate lock type. @@ -278,9 +278,7 @@ DoCopy(const RangeVar *relation, bool binary, bool oids, bool from, bool pipe, aclresult = pg_class_aclcheck(RelationGetRelid(rel), GetUserId(), required_access); if (aclresult != ACLCHECK_OK) - elog(ERROR, "%s: %s", - RelationGetRelationName(rel), - aclcheck_error_strings[aclresult]); + aclcheck_error(aclresult, RelationGetRelationName(rel)); if (!pipe && !superuser()) elog(ERROR, "You must have Postgres superuser privilege to do a COPY " "directly to or from a file. Anyone can COPY to stdout or " |
