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:12:15
Message-ID: 1317755535.2113.1.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, 2011-10-04 at 12:21 -0600, J.V. wrote:
> I have tried:
>
> alter table <table_name> NOCHECK CONSTRAINT ALL;
>
> and it highlights (squiggles) NOCHECK saying : ERROR: syntax error at or
> near "NOCHECK" SQL state: 42601 character 20
>
> but everything I lookup says this this is the way to disable all
> constraints on a table.
>
> Also is there a way to disable all existing constraints on all tables
> everywhere (specifically all pkey & fkey constraints irrespective of how
> they were created) in one statement?
>
> I have searched and searched and find nothing that works.
>

Not sure where you look up, but there's no way to disable constraints in
PostgreSQL. You can disable triggers and rules, but not the constraints.

See http://www.postgresql.org/docs/9.1/interactive/sql-altertable.html

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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message J.V. 2011-10-04 19:20:20 Re: fail: alter table <table_name> NOCHECK CONSTRAINT ALL;
Previous Message Scott Marlowe 2011-10-04 19:09:21 Re: how to select one column into another in same table?