How do I copy an element of composite type array into csv file?

From: a <372660931(at)qq(dot)com>
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: How do I copy an element of composite type array into csv file?
Date: 2018-05-23 08:35:44
Message-ID: tencent_428C1F5C4640DDCF140B725F@qq.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi suppose I have composite type and table

create type A as(
x float8,
y float8
);

create table B(
Ay A[]
);

insert into B
values(array[
(1,2)::A,
(3,4)::B]
);

Now I would like to export the first element of table B into an csv file:

COPY B(Ay[1])
to 'E:/products_199.csv' DELIMITER ',' CSV HEADER;

The code above reported an syntax error.

How should I do it??

Thank you so much!

Shore

Responses

Browse pgsql-general by date

  From Date Subject
Next Message amul sul 2018-05-23 08:41:02 Re: How do I copy an element of composite type array into csv file?
Previous Message Paolo Crosato 2018-05-23 07:39:54 Re: Error on vacuum: xmin before relfrozenxid