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

Re: psql line number reporting from stdin

From: Gurjeet Singh <singh(dot)gurjeet(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: psql line number reporting from stdin
Date: 2011-11-28 13:49:46
Message-ID: CABwTF4X67wZvZp7y80zErE41bVb6aE5o29M=6trK4ZArFTGSqw@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-hackers
On Mon, Nov 28, 2011 at 8:10 AM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:

> On Sat, Nov 26, 2011 at 3:36 PM, Peter Eisentraut <peter_e(at)gmx(dot)net> 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"
> >
> > Other examples for the use of the spelling "<stdin>" in this context
> > include gcc and slonik.
> >
> > Error messages printed in interactive mode will not be affected, of
> > course.
> >
> > Patch attached.
>
> Seems like a good idea to me.
>

Naysayers can always make a case for backwards-compatibility, or not
breaking the scripts written with the existing behaviour in mind. Do our
docs have anything to say about scripts executed from stdin?

-- 
Gurjeet Singh
EnterpriseDB Corporation
The Enterprise PostgreSQL Company

In response to

Responses

pgsql-hackers by date

Next:From: Robert HaasDate: 2011-11-28 13:51:15
Subject: Re: Patch: add timing of buffer I/O requests
Previous:From: Robert HaasDate: 2011-11-28 13:12:23
Subject: Re: odbc_fdw

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