Skip site navigation (1) Skip section navigation (2)

Creating constraint sometime fail in a transaction

From: Olivier Hubaut <olivier(at)scmbb(dot)ulb(dot)ac(dot)be>
To: PgSQL SQL <pgsql-sql(at)postgresql(dot)org>
Subject: Creating constraint sometime fail in a transaction
Date: 2004-02-20 15:49:57
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-sql

I've a strange bug on PgSQL 7.3.3 with function, constraints and 

As the foreign key are too heavy for a massive insert, even set defered, 
we've decided to put them in a function in order to enable/disable them.

So, in such a transaction, first we disable the constraints, using a 
function, then inserting all the data, and afterall put the constraints 
back with another function.

This work fine and quickly... if we do it once. But, when we tried to 
make a big batch with a lot of such transaction, sometime, some 
constraint aren't put back or drop, and the rest of the transactions falls.

So, we're wondering if the action for putting/removing constraint could 
be executed out of the transaction, so that it may overlaps and crash in 
such case.

Does anyone notice the same problem?

Signature en cours de maintenance,
Veuillez patienter...


pgsql-sql by date

Next:From: Richard HuxtonDate: 2004-02-20 15:57:45
Subject: Re: date format in 7.4
Previous:From: Tom LaneDate: 2004-02-20 15:32:26
Subject: Re: date format in 7.4

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group