Re: FKs + partial indexes?

From: David Fetter <david(at)fetter(dot)org>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: FKs + partial indexes?
Date: 2006-11-23 18:05:06
Message-ID: 20061123180506.GA1769@fetter.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Nov 22, 2006 at 01:33:21PM -0500, Andrew Dunstan wrote:
>
> I was thinking a bit about a problem that was mentioned in the
> discussion TomD, Simon Rigga and I had about enums and foreign keys,
> namely that often we find dozens of tiny little reference tables
> littering the data model,

Is this really a problem?

> or else we find a table that somehow consolidates them, plus some
> sort of homegrown referential integrity checks.

That is the standard EAV mistake, born of fear of committing to do
some things and not to do others.

> I wondered if we could improve on that situation by using partial
> unique indexes on the consolidated table, and providing a mechanism
> to specify which index the FK must refer to (or else allow allow an
> optional predicate expression which would have to match the
> predicate expression of the partial index).

Isn't this just putting some lipstick on the EAV pig?

Cheers,
D
--
David Fetter <david(at)fetter(dot)org> http://fetter.org/
phone: +1 415 235 3778 AIM: dfetter666
Skype: davidfetter

Remember to vote!

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Smith 2006-11-23 18:09:54 Re: Direct I/O issues
Previous Message Markus Schiltknecht 2006-11-23 17:26:12 Re: [Replica-hooks-discuss] Integrating Replication ino