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

From: a <372660931(at)qq(dot)com>
To: David G(dot) Johnston <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: amul sul <sulamul(at)gmail(dot)com>, pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re:How do I copy an element of composite type array into csv file?
Date: 2018-05-23 14:03:13
Message-ID: tencent_429D28F860920FD70BD9B46A@qq.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Thank you so much, did you mean the section 8.15.6??

------------------ Original message ------------------
From: "David G. Johnston";
Sendtime: Wednesday, May 23, 2018 9:18 PM
To: "a"<372660931(at)qq(dot)com>;
Cc: "amul sul"; "pgsql-general";
Subject: How do I copy an element of composite type array into csv file?

On Wednesday, May 23, 2018, a <372660931(at)qq(dot)com> wrote:
Thank you very much.

BTW, may I ask if I would like to do the opposite that copy csv file content into the first element, how should I do it??

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

you cannot put "[1]" there. The csv file value has to be an array input literal with only one element. i.e., something like: {(1,2)}

There is no first element as such when you are creating a new record. There will be however many elelements to supply to the array input.

David J.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David G. Johnston 2018-05-23 14:13:19 Re: How do I copy an element of composite type array into csv file?
Previous Message Jeremy Finzel 2018-05-23 13:52:13 Re: found xmin from before relfrozenxid on pg_catalog.pg_authid