From: Oleg Bartunov <oleg@sai.msu.su>
To: Jan Wieck <JanWieck@Yahoo.com>
Cc: Luis Sousa <llsousa@ualg.pt>
Cc: Richard Huxton <dev@archonet.com>
Cc: Filipe Bonjour <fbonjour@urbanet.ch>
Cc: pgsql-sql@postgresql.org
Subject: Re: Can arrays reference primary keys in CREATE TABLE?
Date: Fri, 23 May 2003 10:55:42 +0400 (MSD)
Message-ID: <Pine.GSO.4.55.0305231051580.28360@ra.sai.msu.su> (raw)
In-Reply-To: <3ECCACDB.6030008@Yahoo.com>
References: <pan.2003.05.09.21.21.24.908732@urbanet.ch>
<200305141631.48642.dev@archonet.com>
<3EC272D9.5050203@ualg.pt>
<3EC91704.1080109@Yahoo.com>
<3ECC93F7.60509@ualg.pt>
<3ECCACDB.6030008@Yahoo.com>
On Thu, 22 May 2003, Jan Wieck wrote:
> Luis Sousa wrote:
> > Jan Wieck wrote:
> >> You used a trigger to check something, but unless you have a full set of
> >> said triggers and they do the locking as well, you do not have
> >> referential integrity.
> >>
> >>
> >> Jan
> >>
> >>
> > I guess you are right.
> > I'll have to write a trigger for UPDATE or DELETE. How can I do the lock
> > only on that record ?
>
> That exactly is the problem with arrays here. You can't index an array
> in a way so that you can effectively select all rows who's array
> contains a particular value. Your trigger can only select all of them
there is contrib/intarray which could be used for indexed access to
array of integers. In principle, it should be not difficult to
generalize this module to support many types.
>
> Jan
>
>
Regards,
Oleg
_____________________________________________________________
Oleg Bartunov, sci.researcher, hostmaster of AstroNet,
Sternberg Astronomical Institute, Moscow University (Russia)
Internet: oleg@sai.msu.su, http://www.sai.msu.su/~megera/
phone: +007(095)939-16-83, +007(095)939-23-83
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-sql@postgresql.org
Cc: oleg@sai.msu.su, JanWieck@Yahoo.com, llsousa@ualg.pt, dev@archonet.com, fbonjour@urbanet.ch
Subject: Re: Can arrays reference primary keys in CREATE TABLE?
In-Reply-To: <Pine.GSO.4.55.0305231051580.28360@ra.sai.msu.su>
* 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