On May 16, 2005, at 11:40 AM, Peter Schonefeld wrote:
> Hi, I'm curious as to how to get the following snippet from a backup
> file to
> run as a script?
> COPY country (id, name) FROM stdin;
> 1 Afghanistan
> 2 Albania
> 3 Algeria
> 4 American Samoa
> 5 Andorra
> 6 Angola
Assuming you have tabs there between the values, just put it in a file
and execute it with psql (same way it is used in a backup file).
psql -f thefile database
If you want to have other commands after this in the file, put \. on a
line by itself after the last row:
John DeSoi, Ph.D.
Power Tools for PostgreSQL
In response to
pgsql-novice by date
|Next:||From: cbrazvan||Date: 2005-05-16 18:23:07|
|Subject: Problem with Out-of-resources error?|
|Previous:||From: Andres Ledesma||Date: 2005-05-16 17:08:32|
|Subject: Re: concepts?|