Re: psql line number reporting from stdin - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: psql line number reporting from stdin
Date
Msg-id 1323455030.3451.1.camel@vanquo.pezone.net
Whole thread Raw
In response to psql line number reporting from stdin  (Peter Eisentraut <peter_e@gmx.net>)
Responses Re: psql line number reporting from stdin  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On lör, 2011-11-26 at 22:36 +0200, Peter Eisentraut wrote:
> There is a long-standing oddity in psql that running
> 
> psql -f foo.sql
> 
> returns error messages with file name and line number, like
> 
> psql:foo.sql:1: ERROR:  syntax error at or near "foo"
> 
> but running
> 
> psql < foo.sql does not.  I suggest we change the latter to print
> 
> psql:<stdin>:1: ERROR:  syntax error at or near "foo"

The problem is, this breaks the regression tests, because first the
actual output changes, and second the line numbers get included, which
will create a mess every time you edit a test.  Not sure whether we can
work around that.  Ideas?




pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: static or dynamic libpgport
Next
From: Josh Berkus
Date:
Subject: Re: Core Extensions relocation