dbTalk Databases Forums  

[BUGS] COPY in readonly transaction.

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss [BUGS] COPY in readonly transaction. in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Alon Goldshuv
 
Posts: n/a

Default [BUGS] COPY in readonly transaction. - 10-03-2005 , 05:25 PM






In the folllowing check (copy.coCopy() ), 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.



---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Reply With Quote
  #2  
Old   
Tom Lane
 
Posts: n/a

Default Re: [BUGS] COPY in readonly transaction. - 10-03-2005 , 06:16 PM






"Alon Goldshuv" <agoldshuv (AT) greenplum (DOT) com> writes:
Quote:
In the folllowing check (copy.coCopy() ), I *think* that the check for the
is_from flag is mistakenly negated.
Yeah, it's definitely backward :-( Will fix.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.