INDEX on a composite type

From: GMail <vincenzo(dot)romano(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: INDEX on a composite type
Date: 2007-12-19 21:07:32
Message-ID: 200712192207.32913.vincenzo.romano@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi all.

When trying to create an index on a composite type, I need to enclose
the columns in paranthesis. Is this normal?
I don't think so as there's no mention in the friendly manual.

An example:

create type atype as (
atext text,
anint int
);

create table atable (
info text,
compo atype
);

create index i_atable_compo on atable(
((compo).atext),((compo).anint)
);

With single parenthesis, as suggested by the friendly manual, I get a
syntax error close to the "."

test=# create index i_atable_compo on atable(
(compo).atext,(compo).anint
);
ERROR: syntax error at or near "."
LINE 2: (compo).atext,(compo).anint
^

--
Vincenzo Romano
Maybe Computers will never become as intelligent as Humans.
Surely they won't ever become so stupid. [VR-1989]

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Martijn van Oosterhout 2007-12-19 21:27:25 Re: INDEX on a composite type
Previous Message Scott Marlowe 2007-12-19 20:24:09 Re: Deploy postgres - upgrade strategy