COPY IN as SELECT target

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: COPY IN as SELECT target
Date: 2009-12-17 17:04:46
Message-ID: 4B2A64AE.50405@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Recently there was discussion about allowing a COPY statement to be a
SELECT target, returning a text array, although the syntax wasn't really
nailed down that I recall. I was thinking that we might have

COPY RETURNING ARRAY FROM ...

instead of

COPY tablename opt_column_list FROM ...

the we possibly could do things like:

SELECT t[5] as a, 3*(t[3]::numeric) as b FROM (COPY RETURNING ARRAY
FROM STDIN CSV) as t;

Thoughts?

cheers

andrew

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kevin Grittner 2009-12-17 17:17:20 Re: determine snapshot after obtaining locks for first statement
Previous Message Tom Lane 2009-12-17 16:59:59 Re: determine snapshot after obtaining locks for first statement