pg.ddx.io pgsql-bugs@postgresql.org mailing list archive
help / color / mirror / Atom feedBUG #6083: psql script line numbers incorrectly count \copy data
4+ messages / 4 participants
[nested] [flat]
* BUG #6083: psql script line numbers incorrectly count \copy data
@ 2011-06-29 13:38 Steve Haslam <araqnid@googlemail.com>
2011-07-04 16:02 ` Re: BUG #6083: psql script line numbers incorrectly count \copy data Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 4+ messages in thread
From: Steve Haslam @ 2011-06-29 13:38 UTC (permalink / raw)
To: pgsql-bugs
The following bug has been logged online:
Bug reference: 6083
Logged by: Steve Haslam
Email address: araqnid@googlemail.com
PostgreSQL version: 9.0.4
Operating system: Debian GNU/Linux (amd64)
Description: psql script line numbers incorrectly count \copy data
Details:
test_linenumbers.dat:
1
1
2
3
5
8
test_linenumbers.sql:
DO $$ BEGIN RAISE INFO 'Before copy'; END; $$; -- line 1
CREATE TEMP TABLE test_linenumbers_data(value int);
\copy test_linenumbers_data from test_linenumbers.dat
DO $$ BEGIN RAISE INFO 'After copy'; END; $$; -- line 4
Performing "psql -f test_linenumbers.sql" produces:
psql:test_linenumbers.sql:1: INFO: Before copy
DO
CREATE TABLE
psql:test_linenumbers.sql:11: INFO: After copy
DO
However, it seems to me that the second INFO should be reported against
test_linenumbers.sql:4 rather than :11. Apparently, the data read from \copy
is incrementing the script line number counter?
Also occurs with 9.1b2 and a recent 9.2devel.
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: BUG #6083: psql script line numbers incorrectly count \copy data
2011-06-29 13:38 BUG #6083: psql script line numbers incorrectly count \copy data Steve Haslam <araqnid@googlemail.com>
@ 2011-07-04 16:02 ` Tom Lane <tgl@sss.pgh.pa.us>
2011-07-04 19:01 ` Re: [HACKERS] BUG #6083: psql script line numbers incorrectly count \copy data David Fetter <david@fetter.org>
2011-07-05 13:07 ` Re: BUG #6083: psql script line numbers incorrectly count \copy data Robert Haas <robertmhaas@gmail.com>
0 siblings, 2 replies; 4+ messages in thread
From: Tom Lane @ 2011-07-04 16:02 UTC (permalink / raw)
To: Steve Haslam <araqnid@googlemail.com>; +Cc: pgsql-bugs; pgsql-hackers@postgresql.org
"Steve Haslam" <araqnid@googlemail.com> writes:
> ... Apparently, the data read from \copy
> is incrementing the script line number counter?
Yeah, so it is. That is correct behavior for COPY FROM STDIN,
but not so much for copying from a separate file.
The attached patch seems like an appropriate fix. However, I'm unsure
whether to apply it to released branches ... does anyone think this
might break somebody's application?
regards, tom lane
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: [HACKERS] BUG #6083: psql script line numbers incorrectly count \copy data
2011-06-29 13:38 BUG #6083: psql script line numbers incorrectly count \copy data Steve Haslam <araqnid@googlemail.com>
2011-07-04 16:02 ` Re: BUG #6083: psql script line numbers incorrectly count \copy data Tom Lane <tgl@sss.pgh.pa.us>
@ 2011-07-04 19:01 ` David Fetter <david@fetter.org>
1 sibling, 0 replies; 4+ messages in thread
From: David Fetter @ 2011-07-04 19:01 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Steve Haslam <araqnid@googlemail.com>; pgsql-bugs; pgsql-hackers@postgresql.org
On Mon, Jul 04, 2011 at 12:02:12PM -0400, Tom Lane wrote:
> "Steve Haslam" <araqnid@googlemail.com> writes:
> > ... Apparently, the data read from \copy is incrementing the
> > script line number counter?
>
> Yeah, so it is. That is correct behavior for COPY FROM STDIN, but
> not so much for copying from a separate file.
>
> The attached patch seems like an appropriate fix. However, I'm
> unsure whether to apply it to released branches ... does anyone
> think this might break somebody's application?
No.
Cheers,
David.
--
David Fetter <david@fetter.org> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: david.fetter@gmail.com
iCal: webcal://www.tripit.com/feed/ical/people/david74/tripit.ics
Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: BUG #6083: psql script line numbers incorrectly count \copy data
2011-06-29 13:38 BUG #6083: psql script line numbers incorrectly count \copy data Steve Haslam <araqnid@googlemail.com>
2011-07-04 16:02 ` Re: BUG #6083: psql script line numbers incorrectly count \copy data Tom Lane <tgl@sss.pgh.pa.us>
@ 2011-07-05 13:07 ` Robert Haas <robertmhaas@gmail.com>
1 sibling, 0 replies; 4+ messages in thread
From: Robert Haas @ 2011-07-05 13:07 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Steve Haslam <araqnid@googlemail.com>; pgsql-bugs; pgsql-hackers@postgresql.org
On Mon, Jul 4, 2011 at 12:02 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> "Steve Haslam" <araqnid@googlemail.com> writes:
>> ... Apparently, the data read from \copy
>> is incrementing the script line number counter?
>
> Yeah, so it is. That is correct behavior for COPY FROM STDIN,
> but not so much for copying from a separate file.
>
> The attached patch seems like an appropriate fix. However, I'm unsure
> whether to apply it to released branches ... does anyone think this
> might break somebody's application?
I think this is pretty safe.
--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2011-07-05 13:07 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2011-06-29 13:38 BUG #6083: psql script line numbers incorrectly count \copy data Steve Haslam <araqnid@googlemail.com>
2011-07-04 16:02 ` Tom Lane <tgl@sss.pgh.pa.us>
2011-07-04 19:01 ` David Fetter <david@fetter.org>
2011-07-05 13:07 ` Robert Haas <robertmhaas@gmail.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox