BUG #1936: Read-only transactions ignored in COPY

From: "Alon Goldshuv" <agoldshuv(at)greenplum(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #1936: Read-only transactions ignored in COPY
Date: 2005-10-03 21:53:44
Message-ID: 20051003215344.6DD8BF11F5@svr2.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


The following bug has been logged online:

Bug reference: 1936
Logged by: Alon Goldshuv
Email address: agoldshuv(at)greenplum(dot)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")));

Browse pgsql-bugs by date

  From Date Subject
Next Message Jim C. Nasby 2005-10-03 22:00:09 Re: Unreliable pg_stat_activity, Windows 2000, PostgreSQL 8.1 beta2
Previous Message Kouber Saparev 2005-10-03 18:28:37 Re: BUG #1927: incorrect timestamp returned