Re: How to add constraints without validating data. - Mailing list pgsql-admin

From Iñigo Martinez Lasala
Subject Re: How to add constraints without validating data.
Date
Msg-id 1274976054.19383.37.camel@deimos
Whole thread Raw
In response to How to add constraints without validating data.  (Amit jain <amitjain@synechron.com>)
Responses Re: How to add constraints without validating data.
List pgsql-admin
You have to disable triggers.

Two options:

- Export table data, truncate table (if your table is fk source you will have a problem), add constraint and import exported data with --disable-triggers flag in pg_restore.

- Perhaps you could add manually triger via pg_trigger table in pg_catalog whith an insert into this table.

-----Original Message-----
From: Amit jain <amitjain@synechron.com>
To: pgsql-admin@postgresql.org <pgsql-admin@postgresql.org>
Subject: [ADMIN] How to add constraints without validating data.
Date: Thu, 27 May 2010 17:55:56 +0530

Hi Gurus

Is there any way in postgreSQL to apply constraints forcefully without checking/validating Data ? It should validate only those records which comes after constraints are applied.

I need this help as data is already loaded in database but "ALTER TABLE" sql for adding CONSTRAINTS is taking enormous time.

Thanks for ideas/suggestion in Advance !!


--
Regards,

Amit Jain 
Synechron Technologies Pvt. Ltd. 4th  Floor, B Wing, Block 1.2, Embassy Techzone,
Rajiv Gandhi Infotech Park, Hinjewadi Phase II, Pune 411 057. 
Phone : +91.20.40262000 Ext 2163 | Mobile:+91.9561298565 | VoIP : +1.732.415.0894
http://www.synechron.com  MailTo: amitjain@synechron.com




pgsql-admin by date:

Previous
From: "Kevin Grittner"
Date:
Subject: Re: future development of xml capabilities
Next
From: Nilesh Govindarajan
Date:
Subject: Re: How to add constraints without validating data.