Skip site navigation (1) Skip section navigation (2)

BUG #6083: psql script line numbers incorrectly count \copy data

From: "Steve Haslam" <araqnid(at)googlemail(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #6083: psql script line numbers incorrectly count \copy data
Date: 2011-06-29 13:38:25
Message-ID: 201106291338.p5TDcPTZ012367@wwwmaster.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-bugspgsql-hackers
The following bug has been logged online:

Bug reference:      6083
Logged by:          Steve Haslam
Email address:      araqnid(at)googlemail(dot)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.

Responses

pgsql-hackers by date

Next:From: Merlin MoncureDate: 2011-06-29 13:39:55
Subject: Re: Process local hint bit cache
Previous:From: Robert HaasDate: 2011-06-29 12:52:27
Subject: Re: Range Types, constructors, and the type system

pgsql-bugs by date

Next:From: Stewart FrittsDate: 2011-06-29 14:19:37
Subject: BUG #6084: When Updating Tables with Select Into
Previous:From: Steve HaslamDate: 2011-06-29 13:31:49
Subject: BUG #6082: server segfault - pg_stat_reset_shared(null)

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group