Search Postgresql Archives

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux