Re: Foreign key constraint for array-field? - Mailing list pgsql-hackers

From Dmitry Koterov
Subject Re: Foreign key constraint for array-field?
Date
Msg-id d7df81620809211149p62801b73i80f33cda424b0126@mail.gmail.com
Whole thread Raw
In response to Re: Foreign key constraint for array-field?  ("Joshua D. Drake" <jd@commandprompt.com>)
Responses Re: Foreign key constraint for array-field?  (David Fetter <david@fetter.org>)
List pgsql-hackers
Normalization is not a panacea here. Sometimes such normalization
creates too much overeat and a lot of additional code (especially if
there are a lot of such dependencies). Array support in Postgres is
quite handy; in my practive, moving from a_b_map to arrays economizes
hundreds of lines of stored procedure and calling application code.

Triggers are not very helpful here, because it is too boringly to
control that all needed tables has appropriate triggers (we need N + 1
triggers with unique code, where N is the number of referring tables).

So, built-in support looks much more interesting...

On Sun, Sep 21, 2008 at 8:46 AM, Joshua D. Drake <jd@commandprompt.com> wrote:
> David Fetter wrote:
>>
>> On Sun, Sep 21, 2008 at 04:38:56AM +0400, Dmitry Koterov wrote:
>>>
>>> Hello.
>>>
>>> Is it possible to create a foreign key constraint for ALL elements of
>>> an array field?
>>
>> Whether it's possible or not--it probably is--it's a very bad idea.
>> Just normalize :)
>
> +1
>
>>
>> Cheers,
>> David.
>
>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers
>


pgsql-hackers by date:

Previous
From: Magnus Hagander
Date:
Subject: Re: pg_settings.sourcefile patch is a security breach
Next
From: Andrew Dunstan
Date:
Subject: Re: Foreign key constraint for array-field?