Re: Can arrays reference primary keys in CREATE TABLE? - Mailing list pgsql-sql

From Oleg Bartunov
Subject Re: Can arrays reference primary keys in CREATE TABLE?
Date
Msg-id Pine.GSO.4.55.0305231051580.28360@ra.sai.msu.su
Whole thread Raw
In response to Re: Can arrays reference primary keys in CREATE TABLE?  (Jan Wieck <JanWieck@Yahoo.com>)
Responses Re: Can arrays reference primary keys in CREATE TABLE?  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
List pgsql-sql
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


pgsql-sql by date:

Previous
From: Alexey Dashevsky
Date:
Subject: Re: numeric fields and null
Next
From: Christoph Haller
Date:
Subject: Re: see toast table