INDEX on a composite type - Mailing list pgsql-general

From GMail
Subject INDEX on a composite type
Date
Msg-id 200712192207.32913.vincenzo.romano@gmail.com
Whole thread Raw
Responses Re: INDEX on a composite type
Re: INDEX on a composite type
List 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]

pgsql-general by date:

Previous
From: "Scott Marlowe"
Date:
Subject: Re: Deploy postgres - upgrade strategy
Next
From: Chris Browne
Date:
Subject: Re: Partitioned tables & Slony