Re: TODO list request: FK to unique expression indexes

From: "David E(dot) Wheeler" <david(at)kineticode(dot)com>
To: Josh Berkus <josh(at)agliodbs(dot)com>
Cc: PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: TODO list request: FK to unique expression indexes
Date: 2008-11-19 19:42:22
Message-ID: 04D1AE15-C780-4B25-AFB7-91451C8E4EEE@kineticode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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.

Best,

David

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Magnus Hagander 2008-11-19 19:54:16 Re: Client certificate authentication
Previous Message Tom Lane 2008-11-19 18:46:26 Re: Problem with Bitmap Heap Scan