Re: Re: incorrect exit code from psql with single transaction + violation of deferred FK constraint - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: Re: incorrect exit code from psql with single transaction + violation of deferred FK constraint
Date
Msg-id 201003082303.o28N3Bq09198@momjian.us
Whole thread Raw
In response to Re: Re: incorrect exit code from psql with single transaction + violation of deferred FK constraint  (Bruce Momjian <bruce@momjian.us>)
Responses Re: Re: incorrect exit code from psql with single transaction + violation of deferred FK constraint
List pgsql-hackers
Bruce Momjian wrote:
> BBruce Momjian wrote:
> > Tom Lane wrote:
> > > Bruce Momjian <bruce@momjian.us> writes:
> > > > The attached patch checks for the proper return from BEGIN/COMMIT, and
> > > > properly frees the libpq structures.  In testing, this does return 3 as
> > > > you expected.
> > > 
> > > Really?  It looks to me like you'd get exit(1).  Maybe that's the right
> > > thing, but MainLoop itself seems to return EXIT_USER not EXIT_FAILURE
> > > when it gets an error.
> > 
> > Sorry, you are right.  I must have mis-read my tests.  Updated patch
> > attached.
> 
> I thought some more about it and realized I had to check for the
> on-error-exit flag too. Updated patch attached.

Applied.

--  Bruce Momjian  <bruce@momjian.us>        http://momjian.us EnterpriseDB
http://enterprisedb.com
 PG East:  http://www.enterprisedb.com/community/nav-pg-east-2010.do


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: disabling log_min_duration_statement from pg_dump?
Next
From: Tom Lane
Date:
Subject: Re: Re: incorrect exit code from psql with single transaction + violation of deferred FK constraint