diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2005-10-03 23:43:09 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2005-10-03 23:43:09 +0000 |
commit | 060d13f7c7bf741db848263e40ce42b0ea42e465 (patch) | |
tree | baca8e7aa699e8c6e1fc32e14e915195e509168e /src/backend | |
parent | 53e47cdd799963951c371ea8158996be3b6e603a (diff) | |
download | postgresql-060d13f7c7bf741db848263e40ce42b0ea42e465.tar.gz postgresql-060d13f7c7bf741db848263e40ce42b0ea42e465.zip |
COPY's test for read-only transaction was backward; it prohibited COPY TO
where it should prohibit COPY FROM. Found by Alon Goldshuv.
Diffstat (limited to 'src/backend')
-rw-r--r-- | src/backend/commands/copy.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/commands/copy.c b/src/backend/commands/copy.c index c7b98c4da6b..cd215cb4154 100644 --- a/src/backend/commands/copy.c +++ b/src/backend/commands/copy.c @@ -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), |