COPY and read-only transactions

Started by Peter Eisentrautabout 20 years ago3 messageshackers
Jump to latest
#1Peter Eisentraut
peter_e@gmx.net

I probably made the original mistake in the code, so I refrain from claiming
to know anything about Boolean logic, but this note in the release notes
doesn't seem right:

Fix the sense of the test for read-only transaction in COPY
The code formerly prohibited COPY TO, where it should prohibit COPY FROM.

???

--
Peter Eisentraut
http://developer.postgresql.org/~petere/

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Peter Eisentraut (#1)
Re: COPY and read-only transactions

Peter Eisentraut <peter_e@gmx.net> writes:

I probably made the original mistake in the code, so I refrain from claiming
to know anything about Boolean logic, but this note in the release notes
doesn't seem right:

Fix the sense of the test for read-only transaction in COPY
The code formerly prohibited COPY TO, where it should prohibit COPY FROM.

No, it's correct --- the directions are COPY table TO file or COPY table
FROM file. The FROM case is therefore the one that changes the database.

I've always found that directionality nonintuitive, but it's surely far
too late to reverse the sense.

regards, tom lane

#3Martijn van Oosterhout
kleptog@svana.org
In reply to: Peter Eisentraut (#1)
Re: COPY and read-only transactions

On Thu, Mar 30, 2006 at 02:20:04PM +0200, Peter Eisentraut wrote:

I probably made the original mistake in the code, so I refrain from claiming
to know anything about Boolean logic, but this note in the release notes
doesn't seem right:

Fix the sense of the test for read-only transaction in COPY
The code formerly prohibited COPY TO, where it should prohibit COPY FROM.

COPY FROM STDIN is copying FROM the user TO the database
COPY TO STDIN is copying TO the user FROM the database

Does that help?

--
Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/

Show quoted text

Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
tool for doing 5% of the work and then sitting around waiting for someone
else to do the other 95% so you can sue them.