Re: [HACKERS] psql and libpq fixes - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] psql and libpq fixes
Date
Msg-id 1777.950025014@sss.pgh.pa.us
Whole thread Raw
In response to Re: [HACKERS] psql and libpq fixes  (Peter Eisentraut <e99re41@DoCS.UU.SE>)
Responses Re: [HACKERS] psql and libpq fixes
List pgsql-hackers
Peter Eisentraut <e99re41@DoCS.UU.SE> writes:
>> In general, an existing script is not going to be written with the idea
>> that psql will cut it off at the knees for provoking an error.  If the
>> author *does* want all the rest of the commands to be skipped on error,
>> he'll just have written BEGIN and END around the whole script.

> Last time I checked you couldn't roll back a create table. ;)

Au contraire, rolling back a CREATE works fine.  It's rolling back
a DROP that gives trouble ;-)

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?  I'm not sure how hard it is for psql to keep track
of whether the script is in an xact, so maybe this'd be far harder than
it's worth.  Seems like it deserves some consideration though.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Karel Zak - Zakkr
Date:
Subject: Re: [HACKERS] CFH: Mariposa, distributed DB
Next
From: Tom Lane
Date:
Subject: Re: [HACKERS] New Globe