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

From Tom Lane
Subject Re: Accessing composite type columns in indexes
Date
Msg-id 11251.1141449459@sss.pgh.pa.us
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  (Michael Glaesemann <grzm@myrealbox.com>)
List pgsql-general
Michael Glaesemann <grzm@myrealbox.com> writes:
> Except, why doesn't it work in the CREATE TABLE statement?

The UNIQUE/PRIMARY KEY syntax only allows bare column names, per the SQL
standard.  While there's not any technical reason why we couldn't extend
that syntax, there's a pretty large fear factor involved: we could find
ourselves behind the spec-compliance eight-ball if the SQL committee
exercises their prerogative to extend the syntax in some other
direction.  CREATE INDEX is entirely outside the spec (as the whole
concept of indexes is outside the spec) and so we can pretty much do
what we please within that statement.

This is exactly the same reason why we don't support opclass names in
UNIQUE/PRIMARY KEY, as has been suggested several times recently, eg
http://archives.postgresql.org/pgsql-hackers/2006-03/msg00163.php

            regards, tom lane

pgsql-general by date:

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