Re: Best way to prevent overlapping dates

From: Jeff Davis <pgsql(at)j-davis(dot)com>
To: Michael Glaesemann <grzm(at)seespotcode(dot)net>
Cc: Andrus <kobruleht2(at)hot(dot)ee>, pgsql-general(at)postgresql(dot)org
Subject: Re: Best way to prevent overlapping dates
Date: 2007-05-29 17:41:36
Message-ID: 1180460496.26915.49.camel@dogma.v10.wvs
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, 2007-05-29 at 10:59 -0500, Michael Glaesemann wrote:
> On May 25, 2007, at 3:22 , Andrus wrote:
>
> > CREATE TRIGGER puhkus_sequenced_trigger BEFORE INSERT OR UPDATE ON
> > puhkus
> > FOR EACH ROW EXECUTE PROCEDURE puhkus_sequenced_pkey();
>
> You can also use CREATE CONSTRAINT TRIGGER, which allows you to have
> deferrable constraints. This is useful if statements within a
> transaction may temporarily put the database in a state where it
> violates the constraint: the constraint will be called at the end of
> the transaction to make sure integrity is maintained.
>
> http://www.postgresql.org/docs/8.2/interactive/sql-createconstraint.html
>

The docs say:

"CREATE CONSTRAINT TRIGGER is used within CREATE TABLE/ALTER TABLE and
by pg_dump to create the special triggers for referential integrity. It
is not intended for general use."

Is there harm in using constraint triggers outside of pg_dump? It seems
like deferrable constraints would be useful for many applications, but
the docs imply that it's a bad idea.

Regards,
Jeff Davis

PS: Nice to meet you at PGCon. Hope you enjoyed it as much as I did!

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Joshua 2007-05-29 17:46:45 Re: problems with SELECT query results
Previous Message Andrei Kovalevski 2007-05-29 17:34:46 Re: problems with SELECT query results