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:
@ -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),
|
||||
|
Reference in New Issue
Block a user