Re: FKs + partial indexes?

Поиск
Список
Период
Сортировка
От Jim Nasby
Тема Re: FKs + partial indexes?
Дата
Msg-id FA01C6D9-A54D-47D7-8D88-A7238F929541@decibel.org
обсуждение исходный текст
Ответ на Re: FKs + partial indexes?  (David Fetter <david@fetter.org>)
Ответы Re: FKs + partial indexes?
Список pgsql-hackers
On Nov 23, 2006, at 12:05 PM, David Fetter wrote:
> On Wed, Nov 22, 2006 at 01:33:21PM -0500, Andrew Dunstan wrote:
>> 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?

EAV?

If we're going to improve the situation of needing lookup tables, I  
think the way to do it would be through enums, or allowing user- 
configurable settings on TOAST. The latter would allow you to force  
any value written into a text field to get toasted. If you also allow  
toast to combine multiple identical values into a single row in the  
toast table (it might already do that...), you now have your normal  
lookup-table scenario, without having to define an extra table, RI,  
etc. (Ok, you'd need a check constraint too for "normal" lookup table  
behavior).
--
Jim Nasby                                            jim@nasby.net
EnterpriseDB      http://enterprisedb.com      512.569.9461 (cell)




В списке pgsql-hackers по дате отправления:

Предыдущее
От: Jim Nasby
Дата:
Сообщение: Re: XA support (distributed transactions)
Следующее
От: David Fetter
Дата:
Сообщение: Re: FKs + partial indexes?