pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Creating constraint sometime fail in a transaction
2+ messages / 2 participants
[nested] [flat]

* Creating constraint sometime fail in a transaction
@ 2004-02-20 15:49 Olivier Hubaut <olivier@scmbb.ulb.ac.be>
  2004-02-20 16:37 ` Re: Creating constraint sometime fail in a transaction Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 2+ messages in thread

From: Olivier Hubaut @ 2004-02-20 15:49 UTC (permalink / raw)
  To: pgsql-sql

Hi,

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

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...



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: Creating constraint sometime fail in a transaction
  2004-02-20 15:49 Creating constraint sometime fail in a transaction Olivier Hubaut <olivier@scmbb.ulb.ac.be>
@ 2004-02-20 16:37 ` Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2004-02-20 16:37 UTC (permalink / raw)
  To: Olivier Hubaut <olivier@scmbb.ulb.ac.be>; +Cc: pgsql-sql

Olivier Hubaut <olivier@scmbb.ulb.ac.be> writes:
> 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?

When you didn't show us exactly what you're doing or exactly what went
wrong, it's impossible to say ...

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2004-02-20 16:37 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-02-20 15:49 Creating constraint sometime fail in a transaction Olivier Hubaut <olivier@scmbb.ulb.ac.be>
2004-02-20 16:37 ` Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox