Re: Foreign key constraint for array-field?

From: "Dmitry Koterov" <dmitry(at)koterov(dot)ru>
To: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
Cc: "David Fetter" <david(at)fetter(dot)org>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Foreign key constraint for array-field?
Date: 2008-09-21 18:49:56
Message-ID: d7df81620809211149p62801b73i80f33cda424b0126@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)commandprompt(dot)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(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2008-09-21 19:07:05 Re: Foreign key constraint for array-field?
Previous Message Magnus Hagander 2008-09-21 18:38:44 Re: pg_settings.sourcefile patch is a security breach