From: | Bruce Momjian <bruce(at)momjian(dot)us> |
---|---|
To: | "David E(dot) Wheeler" <david(at)kineticode(dot)com> |
Cc: | Josh Berkus <josh(at)agliodbs(dot)com>, PG Hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: TODO list request: FK to unique expression indexes |
Date: | 2008-11-20 18:21:59 |
Message-ID: | 200811201821.mAKILxt26497@momjian.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
David E. Wheeler wrote:
> On Nov 19, 2008, at 9:12 AM, Josh Berkus wrote:
>
> > Folks,
> >
> > Since it's too late to look at this for 8.4, can the following go on
> > the TODO list?
> >
> > Referential Integrity
> >
> > [] Allow creation of FKs targeting unique expression indexes on the
> > referenced table. Syntax: REFERENCES <reftable> ( ( column
> > expression ) )
> >
> > Reason: current FK rules do not allow creating FKs to columns which
> > are defined as, for example, unique(lower(column)). This forces
> > users to either abandon RI for that table, to store duplicate data,
> > or create superfluous indexes.
> >
> > Hmmm ... I suppose the above would require enabling expression
> > indexes for PKs as well, no?
>
> In 8.4 you should be able to get around this particular example using
> citext.
Yes, good idea on citext.
Allowing foreign keys to point to expression indexes seems to open a can
of worms and I am not sure there is enough demand to warrant it.
--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com
+ If your life is a hard drive, Christ can be your backup. +
From | Date | Subject | |
---|---|---|---|
Next Message | Bruce Momjian | 2008-11-20 18:29:13 | Re: pg_upgrade: How to deal with toast |
Previous Message | Zdenek Kotala | 2008-11-20 18:21:23 | Re: pg_upgrade: How to deal with toast |