Re: [PATCH] Make "psql -1 < file.sql" work as with "-f"

From: David Fetter <david(at)fetter(dot)org>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>, PostgreSQL Developers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH] Make "psql -1 < file.sql" work as with "-f"
Date: 2012-08-08 22:50:22
Message-ID: 20120808225022.GA13591@fetter.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Aug 08, 2012 at 04:55:43PM -0400, Robert Haas wrote:
> On Wed, Aug 1, 2012 at 4:28 AM, Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr> wrote:
> > Dear PostgreSQL developers,
> >
> > Plese find attached a patch so that:
> >
> > Make "psql -1 < file.sql" work as with "-f"
> >
> > Make psql --single-transaction option work on a non-interactive
> > standard input as well, so that "psql -1 < input.sql" behaves as
> > "psql -1 -f input.sql".
> >
> > This saner/less error-prone behavior was discussed in this thread back in
> > June:
> >
> > http://archives.postgresql.org/pgsql-hackers/2012-06/msg00785.php
> >
> > I have tested it manually and it works for me. I'm not sure this is the best
> > possible implementation, but it is a small diff one. I haven't found a place
> > in the regression tests where "psql" could be tested with different options.
> > Did I miss something?
>
> I'm wondering if perhaps -- in addition to what you've done here -- we
> should make "psql -1" error out if reading from a terminal.

+1 for this.

> Because accepting options that are intended to cause important
> behavior changes and then ignoring those options is Bad.

Yes, It Is.

Cheers,
David.
--
David Fetter <david(at)fetter(dot)org> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: david(dot)fetter(at)gmail(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2012-08-08 23:03:09 Re: -Wformat-zero-length
Previous Message Tom Lane 2012-08-08 22:42:27 Re: -Wformat-zero-length