COPY with composite type column

From: Reg Me Please <regmeplease(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: COPY with composite type column
Date: 2007-12-26 11:58:34
Message-ID: 200712261258.34428.regmeplease@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi all.

I have this composite type:

create type ct as (
ct1 text,
ct2 int
);

Then I have this table

create table atable (
somedata numeric,
otherdata text,
compo ct
);

when I try to COPY data to that table and use the following "query"
I get a syntax error message:

COPY atable( somedata,(ct).ct1 ) from stdin;
ERROR: syntax error at or near "("
LINE 1: COPY atable( somedata,(ct).ct1 ) from stdin;
^

The "caret" points to the open parenthesis in "(ct)".
Same error is reported on the first open parenthesis if I write "((ct.).ct1)".

Any hint on how to write this COPY?

--
Reg me, please!

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Reg Me Please 2007-12-26 13:31:04 Re: COPY with composite type column
Previous Message Gurjeet Singh 2007-12-26 07:08:12 Re: how to alter an enum type