COPY in readonly transaction.

From: "Alon Goldshuv" <agoldshuv(at)greenplum(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: COPY in readonly transaction.
Date: 2005-10-03 22:22:17
Message-ID: BF66FD29.9D95%agoldshuv@greenplum.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

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>. The current code allows loading and disallows
reading in read-only.

/* 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")));

Alon.

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Jim C. Nasby 2005-10-03 22:35:02 Race condition in dropdb;createdb
Previous Message Jean-Pierre Pelletier 2005-10-03 22:12:56 Re: Unreliable pg_stat_activity, Windows 2000, PostgreSQL 8.1 beta2