Re: Adding many rows to a table.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Stuart Grimshaw" <stuart(at)stubbynet(dot)org(dot)uk>
Cc: "Postgres-SQL" <pgsql-sql(at)postgreSQL(dot)org>
Subject: Re: Adding many rows to a table.
Date: 2000-05-21 04:54:17
Message-ID: 26976.958884857@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

"Stuart Grimshaw" <stuart(at)stubbynet(dot)org(dot)uk> writes:
> The docs suggest using "copy to" for inserting lots of data. I created a
> string :

> COPY TO keywords FROM STDIN USING DELIMITERS ',';
> 520,cheese
> 520,bread
> 521,pickle
> 522,spam
> \.

> and then executed it, and got the following error

> ERROR: parser: parse error at or near "520"

> So my question is, after all that, is that the right way to construct my
> string (regardless of language, Perl C/C++ etc)

That does work as a psql script. In other client interfaces you might
need to submit the COPY data separately from the initial COPY command.
Hard to say more without knowing exactly what you tried with which
interface ...

regards, tom lane

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Peter Eisentraut 2000-05-21 16:45:20 Re: Foreign keys breaks tables permissions
Previous Message Stuart Grimshaw 2000-05-20 21:53:57 Adding many rows to a table.