pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: rodrigo.sakai@zanthus.com.br
Cc: pgsql-interfaces@postgresql.org
Subject: Re: RES: Creating a new type
Date: Thu, 29 Jun 2006 09:47:00 -0400
Message-ID: <20097.1151588820@sss.pgh.pa.us> (raw)
In-Reply-To: <000001c69b78$e5cfcee0$4700a8c0@TREEZANTHUS>
References: <000001c69b78$e5cfcee0$4700a8c0@TREEZANTHUS>

"Rodrigo Sakai" <rodrigo.sakai@zanthus.com.br> writes:
>   So, I have to guarantee that this situation doesn't occur! But I don't
> want to use triggers because this check must be done on almost all tables
> that uses the type:

The fact that you don't want to do it doesn't make it the wrong
solution ;-)

At the moment there is no other way than a trigger.  There's been some
speculation about whether GIST indexes could be extended to enforce
conditions like "no overlapping values in this column" (as a
generalization of the concept of unique indexes).  No one's tried to
make that happen, though.

BTW, you might want to look at the "timetravel" code in contrib/spi/
... it's a tad old and crufty, but it sounds like you are trying to do
something pretty similar to that.

			regards, tom lane



view thread (2+ messages)

Message-ID: <20097.1151588820@sss.pgh.pa.us>
Permalink:  ../20097.1151588820@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/20097.1151588820@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: tgl@sss.pgh.pa.us, rodrigo.sakai@zanthus.com.br
  Subject: Re: RES: Creating a new type
  In-Reply-To: <20097.1151588820@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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