Re: Accessing composite type columns in indexes - Mailing list pgsql-general

From Michael Glaesemann
Subject Re: Accessing composite type columns in indexes
Date
Msg-id 02A1C644-A49A-4176-9FDF-CF475D7A585F@myrealbox.com
Whole thread Raw
In response to Re: Accessing composite type columns in indexes  (Michael Glaesemann <grzm@myrealbox.com>)
Responses Re: Accessing composite type columns in indexes
List pgsql-general
On Mar 4, 2006, at 13:44 , Michael Glaesemann wrote:

> On Mar 4, 2006, at 13:31 , Tom Lane wrote:
>> Make sense now?
>
> Yep!

Except, why doesn't it work in the CREATE TABLE statement? One needs
to add the UNIQUE index as a separate command. For example,

-- doesn't work
create table foo
(
    foo date_co_interval
    , unique (((foo).from_date), ((foo).to_date))
);

-- fails (as expected)
create table foo
(
    foo date_co_interval
    , unique (((foo.foo).from_date), ((foo.foo).to_date))
);

-- works
create table foo (foo date_co_interval);
create unique index foo_idx on foo (((foo).from_date), ((foo).to_date));

Is this also excluded because of some parser ambiguity?

Michael Glaesemann
grzm myrealbox com




pgsql-general by date:

Previous
From: Michael Glaesemann
Date:
Subject: Re: Accessing composite type columns in indexes
Next
From: Tom Lane
Date:
Subject: Re: Accessing composite type columns in indexes