mirror of
https://github.com/postgres/postgres.git
synced 2025-07-08 11:42:09 +03:00
Read-only transactions, as defined in SQL.
This commit is contained in:
@ -9,7 +9,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.187 2002/12/15 16:17:38 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.188 2003/01/10 22:03:27 petere Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -348,6 +348,10 @@ DoCopy(const CopyStmt *stmt)
|
||||
*/
|
||||
rel = heap_openrv(relation, (is_from ? RowExclusiveLock : AccessShareLock));
|
||||
|
||||
/* check read-only transaction */
|
||||
if (XactReadOnly && !is_from && !isTempNamespace(RelationGetNamespace(rel)))
|
||||
elog(ERROR, "transaction is read-only");
|
||||
|
||||
/* Check permissions. */
|
||||
aclresult = pg_class_aclcheck(RelationGetRelid(rel), GetUserId(),
|
||||
required_access);
|
||||
|
Reference in New Issue
Block a user