Skip site navigation (1) Skip section navigation (2)

Re: Re: incorrect exit code from psql with single transaction + violation of deferred FK constraint

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Dominic Bevacqua <dominic(dot)bevacqua(at)bpmlogic(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Re: incorrect exit code from psql with single transaction + violation of deferred FK constraint
Date: 2010-03-08 00:47:42
Message-ID: 201003080047.o280lgo04791@momjian.us (view raw or flat)
Thread:
Lists: pgsql-bugspgsql-hackers
BBruce Momjian wrote:
> Tom Lane wrote:
> > Bruce Momjian <bruce(at)momjian(dot)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.

-- 
  Bruce Momjian  <bruce(at)momjian(dot)us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  PG East:  http://www.enterprisedb.com/community/nav-pg-east-2010.do

Attachment: /pgpatches/psql-1
Description: text/x-diff (1.0 KB)

In response to

Responses

pgsql-hackers by date

Next:From: Takahiro ItagakiDate: 2010-03-08 01:46:03
Subject: ecpg compiler warning about char* comparison
Previous:From: Joshua WaihiDate: 2010-03-08 00:34:21
Subject: Re: [HACKERS] SQL compatibility reminder: MySQL vs PostgreSQL

pgsql-bugs by date

Next:From: SavitaDate: 2010-03-08 10:19:26
Subject: BUG #5365: pg_ctl start gives error
Previous:From: Bruce MomjianDate: 2010-03-08 00:30:18
Subject: Re: Re: incorrect exit code from psql with single transaction + violation of deferred FK constraint

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group