Re: COPY IN as SELECT target

From: David Fetter <david(at)fetter(dot)org>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, Andrew Dunstan <andrew(at)dunslane(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: COPY IN as SELECT target
Date: 2009-12-17 17:38:08
Message-ID: 20091217173808.GF3000@fetter.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Dec 17, 2009 at 12:28:50PM -0500, Robert Haas wrote:
> On Thu, Dec 17, 2009 at 12:23 PM, Heikki Linnakangas
> <heikki(dot)linnakangas(at)enterprisedb(dot)com> wrote:
> > How about just COPY FROM? As in
> >
> > SELECT t[5] as a, 3*(t[3]::numeric) as b FROM (COPY FROM STDIN
> > CSV) as t
>
> I had the same thought. Though it would also be nice to allow
> something like:
>
> COPY (type1, type2, type3, type4) FROM STDIN CSV
>
> ...which is obviously going to create a horrible parser problem if
> you actually tried to use that syntax.

How about using the CTE syntax?

Cheers,
David.
--
David Fetter <david(at)fetter(dot)org> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: david(dot)fetter(at)gmail(dot)com
iCal: webcal://www.tripit.com/feed/ical/people/david74/tripit.ics

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2009-12-17 17:39:58 Re: determine snapshot after obtaining locks for first statement
Previous Message Robert Haas 2009-12-17 17:28:50 Re: COPY IN as SELECT target