On Sep 21, 2008, at 4:18 AM, Simon Riggs wrote:
On Sun, 2008-09-21 at 04:38 +0400, Dmitry Koterov wrote:
Is it possible to create a foreign key constraint for ALL elements of
an array field?
CREATE TABLE a(id INTEGER);
CREATE TABLE b(id INTEGER, a_ids INTEGER[]);
Field b.a_ids contains a
On Sun, 2008-09-21 at 04:38 +0400, Dmitry Koterov wrote:
Is it possible to create a foreign key constraint for ALL elements of
an array field?
CREATE TABLE a(id INTEGER);
CREATE TABLE b(id INTEGER, a_ids INTEGER[]);
Field b.a_ids contains a list of ID's of a table. I want to ensure
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
Simon Riggs wrote:
No, its not possible. Need a trigger.
I think we should support it though. If we extend the relational model
with arrays then it would be sensible if we support this aspect as
well.
Implementation would be fairly straightforward. ri_triggers currently
assumes a non-array
On Sun, Sep 21, 2008 at 10:49:56PM +0400, Dmitry Koterov wrote:
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
I strongly suspect you'd benefit a lot more by learning database best
practices rather than assuming, as you appear to be doing, that you
are dealing with a new field and that you know it best. Neither is true.
Of course, you absolutely right. I venerate you! O! :-)
--
Sent via
On Sun, 2008-09-21 at 15:07 -0400, Andrew Dunstan wrote:
Simon Riggs wrote:
No, its not possible. Need a trigger.
I think we should support it though. If we extend the relational model
with arrays then it would be sensible if we support this aspect as
well.
Implementation would
Hello.
Is it possible to create a foreign key constraint for ALL elements of
an array field?
CREATE TABLE a(id INTEGER);
CREATE TABLE b(id INTEGER, a_ids INTEGER[]);
Field b.a_ids contains a list of ID's of a table. I want to ensure
that each element in b.a_ids exists in a in any time. Is it
On Sat, Sep 20, 2008 at 8:38 PM, Dmitry Koterov [EMAIL PROTECTED] wrote:
Hello.
Is it possible to create a foreign key constraint for ALL elements of
an array field?
CREATE TABLE a(id INTEGER);
CREATE TABLE b(id INTEGER, a_ids INTEGER[]);
Field b.a_ids contains a list of ID's of a table.
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 :)
Cheers,
David.
--
David Fetter [EMAIL
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.
--
11 matches
Mail list logo