Re: disable triggers using psql

From: Geoffrey Myers <lists(at)serioustechnology(dot)com>
To: Greg Sabino Mullane <greg(at)turnstep(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: disable triggers using psql
Date: 2011-02-18 15:35:01
Message-ID: 4D5E91A5.5070406@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
>
>
>> So I added the on_error_rollback to the script and I get this:
> ...
>> psql:test.sql:12: ERROR: current transaction is aborted, commands
>> ignored until end of transaction block
>
> That isn't right: are you sure you said ON_ERROR_ROLLBACK? It's
> case-sensitive. Anyway, try this shortened version:

cut and paste:

set ON_ERROR_ROLLBACK;

When I try the below, I get:

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

INSERT 0 1
b
---
2
(1 row)

ROLLBACK

>
> BEGIN;
>
> CREATE TEMP TABLE abc (a INT PRIMARY KEY);
>
> CREATE TEMP TABLE def (b INT NOT NULL REFERENCES abc(a));
>
> SET session_replication_role = replica;
>
> SELECT 'No error:';
>
> INSERT INTO def(b) VALUES (2);
>
> SELECT * FROM def;
>
> ROLLBACK;
>
> - --
> Greg Sabino Mullane greg(at)turnstep(dot)com
> End Point Corporation http://www.endpoint.com/
> PGP Key: 0x14964AC8 201102180938
> http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8
> -----BEGIN PGP SIGNATURE-----
>
> iEYEAREDAAYFAk1ehJEACgkQvJuQZxSWSsj/5gCgjsQa+nzZz26xQ7c70Bxl5Hs3
> AuUAn1uD7MY2BtGR7usl45pC3Yv2pqVS
> =mLCm
> -----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 trex005 2011-02-18 15:40:59 Schema Archive cant find table
Previous Message Greg Sabino Mullane 2011-02-18 14:39:44 Re: disable triggers using psql