Re: psql: ON_ERROR_STOP command-line flag for scripts

From: Stephen Frost <sfrost(at)snowman(dot)net>
To: Mike Toews <mwtoews(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: psql: ON_ERROR_STOP command-line flag for scripts
Date: 2010-06-07 16:52:31
Message-ID: 20100607165231.GD21875@tamriel.snowman.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

* Mike Toews (mwtoews(at)gmail(dot)com) wrote:
> I know I can either embed a non-SQL command in the SQL file or add
> --set ON_ERROR_STOP =1 to the command arguments, however I'd like a
> simpler command interface (just like there is -q / --quiet for QUIET).
> Could I suggest a new command-line option -r / --on-error-stop for
> psql? I have limited programming with C, should I bother submitting a
> patch, or is someone else eager?

Honestly, I'd love to see something like "--script" that does a number
of things:

Forcibly set (regardless of .psqlrc, in particular):
--no-psqlrc
--echo-all
--single-transaction

ON_ERROR_ROLLBACK=off
ON_ERROR_STOP=on
AUTOCOMMIT=off

Assume "-f -" if no -f passed in (provided this actually works as
expected.. I'm not sure it does, I remember there being some discussion
about this recently).

Thanks,

Stephen

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Smith 2010-06-07 17:34:38 Re: [HACKERS] Invalid YAML output from EXPLAIN
Previous Message Florian Weimer 2010-06-07 16:39:45 Re: [HACKERS] Invalid YAML output from EXPLAIN