Re: [HACKERS] assertions and constraint triggers

2010-08-15 Thread Tom Lane
Peter Eisentraut writes: > Thinking about SQL assertions (check constraints that are independent of > one particular table), do you think it would be reasonable to implement > those on top of constraint triggers? On creation you'd hook up a > trigger to each of the affected tables. And the trigg

Re: [HACKERS] assertions and constraint triggers

2010-08-11 Thread Peter Eisentraut
On ons, 2010-08-11 at 10:47 -0400, Tom Lane wrote: > > I thought the point of ASSERTIONs was that you could write a thing > such as: > > CREATE ASSERTION foo CHECK ((SELECT count(*) FROM tbl) = 4); > > Enforcing that kind of constraints without true serializability > seems > > impractical. > > En

Re: [HACKERS] assertions and constraint triggers

2010-08-11 Thread Peter Eisentraut
On ons, 2010-08-11 at 13:23 +0300, Marko Tiikkaja wrote: > But you'd have to somehow make the constraints to be checked > with true serializability, and that part of the original suggestion > seemed to be completely missing. Not sure how hard that would be > though. I don't think somehow runnin

Re: [HACKERS] assertions and constraint triggers

2010-08-11 Thread Tom Lane
Marko Tiikkaja writes: > On 8/11/10 8:31 AM +0300, Peter Eisentraut wrote: >> Thinking about SQL assertions (check constraints that are independent of >> one particular table), do you think it would be reasonable to implement >> those on top of constraint triggers? On creation you'd hook up a >>

Re: [HACKERS] assertions and constraint triggers

2010-08-11 Thread Kevin Grittner
Marko Tiikkaja wrote: > On 8/11/10 1:18 PM +0300, Peter Eisentraut wrote: >> On ons, 2010-08-11 at 10:54 +0300, Marko Tiikkaja wrote: >>> Enforcing that kind of constraints without true serializability >>> seems impractical. >> >> Yes, but that is being worked on, I understand. > > Correct. But

Re: [HACKERS] assertions and constraint triggers

2010-08-11 Thread Marko Tiikkaja
On 8/11/10 1:18 PM +0300, Peter Eisentraut wrote: On ons, 2010-08-11 at 10:54 +0300, Marko Tiikkaja wrote: Enforcing that kind of constraints without true serializability seems impractical. Yes, but that is being worked on, I understand. Correct. But you'd have to somehow make the constrain

Re: [HACKERS] assertions and constraint triggers

2010-08-11 Thread Peter Eisentraut
On ons, 2010-08-11 at 10:54 +0300, Marko Tiikkaja wrote: > Enforcing that kind of constraints without true serializability seems > impractical. Yes, but that is being worked on, I understand. -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscrip

Re: [HACKERS] assertions and constraint triggers

2010-08-11 Thread Nicolas Barbier
2010/8/11 Marko Tiikkaja : > On 8/11/10 8:31 AM +0300, Peter Eisentraut wrote: > >> Thinking about SQL assertions (check constraints that are independent of >> one particular table), do you think it would be reasonable to implement >> those on top of constraint triggers?  On creation you'd hook up

Re: [HACKERS] assertions and constraint triggers

2010-08-11 Thread Simon Riggs
On Wed, 2010-08-11 at 08:31 +0300, Peter Eisentraut wrote: > Thinking about SQL assertions (check constraints that are independent of > one particular table), do you think it would be reasonable to implement > those on top of constraint triggers? On creation you'd hook up a > trigger to each of t

Re: [HACKERS] assertions and constraint triggers

2010-08-11 Thread Marko Tiikkaja
On 8/11/10 8:31 AM +0300, Peter Eisentraut wrote: Thinking about SQL assertions (check constraints that are independent of one particular table), do you think it would be reasonable to implement those on top of constraint triggers? On creation you'd hook up a trigger to each of the affected tabl

[HACKERS] assertions and constraint triggers

2010-08-10 Thread Peter Eisentraut
Thinking about SQL assertions (check constraints that are independent of one particular table), do you think it would be reasonable to implement those on top of constraint triggers? On creation you'd hook up a trigger to each of the affected tables. And the trigger function runs the respective ch