Skip site navigation (1) Skip section navigation (2)

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: (view raw, whole thread or download thread mbox)
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 :

> 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

pgsql-sql by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group