pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Stuart Grimshaw <stuart@stubbynet.org.uk>
Cc: Postgres-SQL <pgsql-sql@postgreSQL.org>
Subject: Re: Adding many rows to a table.
Date: Sun, 21 May 2000 00:54:17 -0400
Message-ID: <26976.958884857@sss.pgh.pa.us> (raw)
In-Reply-To: <004101bfc2a5$e6a18280$0200000a@home.stubbynet.org.uk>
References: <004101bfc2a5$e6a18280$0200000a@home.stubbynet.org.uk>

"Stuart Grimshaw" <stuart@stubbynet.org.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



view thread (2+ messages)

Message-ID: <26976.958884857@sss.pgh.pa.us>
Permalink:  ../26976.958884857@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/26976.958884857@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, stuart@stubbynet.org.uk
  Subject: Re: Adding many rows to a table.
  In-Reply-To: <26976.958884857@sss.pgh.pa.us>
  References: <004101bfc2a5$e6a18280$0200000a@home.stubbynet.org.uk> <26976.958884857@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox