Re: Insert more than one t-uple in a single sql

From: David Fetter <david(at)fetter(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Rick Gigger <rick(at)alpinenetworking(dot)com>, Chris <dmagick(at)gmail(dot)com>, Gonzalo Villegas <chalo1970(at)hotmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Insert more than one t-uple in a single sql
Date: 2006-02-10 01:11:57
Message-ID: 20060210011157.GC15836@fetter.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Feb 09, 2006 at 07:12:45PM -0500, Tom Lane wrote:
> >> You can't do that in postgres, sorry. That's a mysql-ism.
> >>
> >> Gonzalo Villegas wrote:
> >>
> >>> It must be something like
> >>> insert into table (field1,field2,...) values (v1,v2,...),(b1,b2,...),
> >>> (c1,c2,...)
>
> Actually, that's not a mysql-ism, it's SQL-spec syntax. We haven't
> got round to implementing it, partly because the SELECT ... UNION
> ALL ... syntax provides a perfectly good substitute. It is on the
> TODO list though.

Another way it's different from COPY is that the VALUES can take
expressions.

What all would need to change in order to implement this? There
appear to be things in src/backend/parser and src/bin/psql that bear
on this. Would libpq and ecpg need to change?

Cheers,
D
--
David Fetter david(at)fetter(dot)org http://fetter.org/
phone: +1 415 235 3778

Remember to vote!

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David Rio Deiros 2006-02-10 02:21:51 Re: distinct not working in a multiple join
Previous Message Tom Lane 2006-02-10 00:20:19 Re: distinct not working in a multiple join