Re: adding support for zero-attribute unique/etc keys - Mailing list pgsql-hackers

From Brendan Jurd
Subject Re: adding support for zero-attribute unique/etc keys
Date
Msg-id CADxJZo0MaMRUNEm4Akm_pWDr2hBBgzN3MxoTRx-WH1445GQXsA@mail.gmail.com
Whole thread Raw
In response to Re: adding support for zero-attribute unique/etc keys  (Darren Duncan <darren@darrenduncan.net>)
Responses Re: adding support for zero-attribute unique/etc keys
List pgsql-hackers
On 26 March 2013 05:04, Darren Duncan <darren@darrenduncan.net> wrote:
> On 2013.03.25 1:17 AM, Albe Laurenz wrote:
>> The desired effect can be had today with a unique index:
>>
>> CREATE TABLE singleton (id integer);
>> CREATE UNIQUE INDEX singleton_idx ON singleton((1));
>
> Okay, that is helpful, and less of a kludge than what I was doing, but it is
> still a kludge compared to what I'm proposing, which I see as elegant.
>

FWIW I think an index on (TRUE) expresses the intention more clearly
than an index on () would.

I don't have any objection to the purely logical sense of the
zero-attribute key, but it's hard to see the pragmatic value.

Cheers,
BJ



pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: Limiting setting of hint bits by read-only queries; vacuum_delay
Next
From: Kevin Grittner
Date:
Subject: Re: Limiting setting of hint bits by read-only queries; vacuum_delay