The following bug has been logged online:
Bug reference: 1936
Logged by: Alon Goldshuv
Email address: agoldshuv@greenplum.com
PostgreSQL version: 8 (Current Dev)
Operating system: any
Description: Read-only transactions ignored in COPY
Details:
In the folllowing check (copy.c:DoCopy() ), i *think* that the check for the
is_from flag is mistakenly negated. is_from means -> from file to database,
therefore we should check for <XactReadOnly && is_from>, and not
<XactReadOnly && !is_from>
/* check read-only transaction */
if (XactReadOnly && !is_from &&
!isTempNamespace(RelationGetNamespace(cstate->rel)))
ereport(ERROR,
(errcode(ERRCODE_READ_ONLY_SQL_TRANSACTION),
errmsg("transaction is read-only")));