Re: fail: alter table <table_name> NOCHECK CONSTRAINT ALL;

From: Guillaume Lelarge <guillaume(at)lelarge(dot)info>
To: "J(dot)V(dot)" <jvsrvcs(at)gmail(dot)com>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: fail: alter table <table_name> NOCHECK CONSTRAINT ALL;
Date: 2011-10-04 19:39:59
Message-ID: 1317757199.2113.6.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, 2011-10-04 at 13:20 -0600, J.V. wrote:
> Is there a way to disable all "trigger user' in one statement? (and then
> re-enable?)
>

I guess that if you took the time to read the man page at the URL I gave
you, you would have seen this:

ALTER TABLE [ ONLY ] name [ * ]
action [, ... ]
...
where action is one of:
...
DISABLE TRIGGER [ trigger_name | ALL | USER ]
ENABLE TRIGGER [ trigger_name | ALL | USER ]

So, yes, there is a way. For one table, that is.

> One docs says primary keys and foreign keys are "user triggers"
>

Foreign keys are implemented as triggers. If you disable triggers, you
also disable foreign keys. It doesn't apply to primary keys, which
aren't triggers.

And, please, stop top-posting.

--
Guillaume
http://blog.guillaume.lelarge.info
http://www.dalibo.com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Dave Page 2011-10-04 19:46:47 Re: [GENERAL] One-click installer, Windows 7 32-bit, and icacls.exe
Previous Message J.V. 2011-10-04 19:21:37 Re: how to select one column into another in same table?