Re: disable triggers using psql

From: Geoffrey Myers <lists(at)serioustechnology(dot)com>
To: Greg Sabino Mullane <greg(at)turnstep(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: disable triggers using psql
Date: 2011-02-18 14:24:49
Message-ID: 4D5E8131.5010909@serioustechnology.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Greg Sabino Mullane wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: RIPEMD160
>
>
>> psql:test.sql:11: ERROR: current transaction is aborted, commands
>> ignored until end of transaction block
>
> Oops my bad, I forgot to tell you I have
> \set ON_ERROR_ROLLBACK on
> in my .psqlrc. So you'll need to add that to the top of
> the script. Or just comment out the first insert and
> see if the second one works. If it doesn't, something weird
> is going on with Postgres. If it does, something weird is
> going on with your script and I would recommend breaking your
> dump script down into smaller pieces to see what is happening.
> Most likely session_replication_role is not getting set or
> is getting reset somewhere.

So I added the on_error_rollback to the script and I get this:

BEGIN
psql:test.sql:4: NOTICE: CREATE TABLE / PRIMARY KEY will create
implicit index "abc_pkey" for table "abc"
CREATE TABLE
CREATE TABLE
?column?
----------
Error:
(1 row)

psql:test.sql:10: ERROR: insert or update on table "def" violates
foreign key constraint "def_b_fkey"
DETAIL: Key (b)=(1) is not present in table "abc".
psql:test.sql:12: ERROR: current transaction is aborted, commands
ignored until end of transaction block
psql:test.sql:14: ERROR: current transaction is aborted, commands
ignored until end of transaction block
psql:test.sql:16: ERROR: current transaction is aborted, commands
ignored until end of transaction block
psql:test.sql:18: ERROR: current transaction is aborted, commands
ignored until end of transaction block
ROLLBACK

>
> - --
> Greg Sabino Mullane greg(at)endpoint(dot)com greg(at)turnstep(dot)com
> End Point Corporation 610-983-9073
> PGP Key: 0x14964AC8 201102172155
> http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8
> -----BEGIN PGP SIGNATURE-----
>
> iEYEAREDAAYFAk1d360ACgkQvJuQZxSWSsidCQCfTnQxp5w6psa3C9NREX0ecZ+j
> Ft0An2JKofuxVJNwxhVkh4NBTJU3Xcom
> =fLDa
> -----END PGP SIGNATURE-----
>
>
>

--
Until later, Geoffrey

"I predict future happiness for America if they can prevent
the government from wasting the labors of the people under
the pretense of taking care of them."
- Thomas Jefferson

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Merlin Moncure 2011-02-18 14:32:50 Re: libpq and Datums management with embedded C function
Previous Message Steven Elliott 2011-02-18 14:00:45 Re: The efficiency of the WAL log writer