1
0
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:
Peter Eisentraut
2003-01-10 22:03:30 +00:00
parent b7ca9bdf18
commit b65cd56240
16 changed files with 427 additions and 146 deletions

View File

@ -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);