1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-05 07:21:24 +03:00

COPY's test for read-only transaction was backward; it prohibited COPY TO

where it should prohibit COPY FROM.  Found by Alon Goldshuv.
This commit is contained in:
Tom Lane
2005-10-03 23:43:09 +00:00
parent 53e47cdd79
commit 060d13f7c7
2 changed files with 13 additions and 3 deletions

View File

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/commands/copy.c,v 1.251 2005/09/24 22:54:36 tgl Exp $
* $PostgreSQL: pgsql/src/backend/commands/copy.c,v 1.252 2005/10/03 23:43:09 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -857,7 +857,7 @@ DoCopy(const CopyStmt *stmt)
(is_from ? RowExclusiveLock : AccessShareLock));
/* check read-only transaction */
if (XactReadOnly && !is_from &&
if (XactReadOnly && is_from &&
!isTempNamespace(RelationGetNamespace(cstate->rel)))
ereport(ERROR,
(errcode(ERRCODE_READ_ONLY_SQL_TRANSACTION),