Re: [HACKERS] psql and libpq fixes

From: Peter Eisentraut <e99re41(at)DoCS(dot)UU(dot)SE>
To: Brian E Gallew <geek+(at)cmu(dot)edu>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, PostgreSQL Development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: [HACKERS] psql and libpq fixes
Date: 2000-02-10 16:12:54
Message-ID: Pine.GSO.4.02A.10002101708310.19049-100000@Zebra.DoCS.UU.SE
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, 10 Feb 2000, Brian E Gallew wrote:

> Then <tgl(at)sss(dot)pgh(dot)pa(dot)us> spoke up and said:
> > Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > >> This does bring up a thought --- should psql's kill-the-script-on-error
> > >> option perhaps zap the script only for errors committed outside of a
> > >> transaction block?
> >
> > But on third thought, probably the thing that would be really useful
> > for "expected errors" is if there is a backslash-command that turns on
> > or off the kill-on-error behavior. (The command line switch would
> > merely set the initial state of this flag.) This way, a script could
> > use the option in an intelligent fashion:

FYI, the commands are
\set EXIT_ON_ERROR
and
\unset EXIT_ON_ERROR
It's a normal psql variable, but incidentally the syntax seems kind of
easy to remember.

>
> Urhm, wouldn't a better idea be to have something like Ingres' "ON
> ERROR" and "ON WARNING" settings? In Ingres esqlc, you can create
> functions and then tell Ingres to execute them in the even of a
> warning or error. Also, you can say "ON ERROR CONTINUE" and errors
> will then be returned to the application as a status, but otherwise
> ignored.

That's very nice and all, but psql doesn't work that way. I'm not sure how
other dbs organize their front-end internally, but that sort of scheme
would really take psql places we might not want it to go, and for which it
hasn't been designed -- namely, to be a programming language.

--
Peter Eisentraut Sernanders vaeg 10:115
peter_e(at)gmx(dot)net 75262 Uppsala
http://yi.org/peter-e/ Sweden

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2000-02-10 16:16:31 Re: [HACKERS] psql and libpq fixes
Previous Message Peter Eisentraut 2000-02-10 16:08:14 Re: [HACKERS] createdb default arguments