On Sun, 2002-05-05 at 10:31, G wrote:
>
> Hello,
>
> Just getting started with postgres. Is there an equivalent sql command to
> insert multiple rows? In mysql it's:
>
> insert into table (a,b,c)
> values (1,2,3), (4,5,6);
>
> I exported 6000 rows from mysql using single inserts - it's rather slow
> executing them one by one into progresql.
In PostgreSQL you should:
BEGIN WORK;
INSERT .....
...
COMMIT;
To have it all happen much quicker.
There is not equivalent syntax to the non-standard-SQL of MySQL within
the SQL standard, nor does PostgreSQL have such an extension.
If you can get the data in tab-delimited format you could also use the
COPY command in PostgreSQL to load the data much faster.
Regards,
Andrew.
--
--------------------------------------------------------------------
Andrew @ Catalyst .Net.NZ Ltd, PO Box 11-053, Manners St, Wellington
WEB: http://catalyst.net.nz/ PHYS: Level 2, 150-154 Willis St
DDI: +64(4)916-7201 MOB: +64(21)635-694 OFFICE: +64(4)499-2267
Are you enrolled at http://schoolreunions.co.nz/ yet?