pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Steve Haslam <araqnid@googlemail.com>
To: pgsql-bugs@postgresql.org
Subject: BUG #6083: psql script line numbers incorrectly count \copy data
Date: Wed, 29 Jun 2011 13:38:25 GMT
Message-ID: <201106291338.p5TDcPTZ012367@wwwmaster.postgresql.org> (raw)


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.



view thread (4+ messages)  latest in thread

Message-ID: <201106291338.p5TDcPTZ012367@wwwmaster.postgresql.org>
Permalink:  ../201106291338.p5TDcPTZ012367@wwwmaster.postgresql.org/
Also on:    postgresql.org/message-id/201106291338.p5TDcPTZ012367@wwwmaster.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: araqnid@googlemail.com
  Subject: Re: BUG #6083: psql script line numbers incorrectly count \copy data
  In-Reply-To: <201106291338.p5TDcPTZ012367@wwwmaster.postgresql.org>
  References: <201106291338.p5TDcPTZ012367@wwwmaster.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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