Received: from hdi.de (brandmauer.hdi.de [212.76.146.194])
by hub.org (8.9.3/8.9.3) with ESMTP id FAA27128
for ; Wed, 20 Oct 1999 05:50:55 -0400 (EDT)
(envelope-from Vollmers@hdi.de)
Received: by hdilan.hdi.de id <28729>; Wed, 20 Oct 1999 12:00:20 +0100
Sender: root@hdi.de
Message-Id: <99Oct20.120020gmt+0100.28729@hdilan.hdi.de>
Date: Wed, 20 Oct 1999 11:02:15 +0100
From: Georg Vollmers
Organization: HDI V.a.G.
X-Mailer: Mozilla 4.61 [en] (X11; I; Linux 2.2.9 i586)
X-Accept-Language: en
MIME-Version: 1.0
To: docs@postgresql.org
Subject: Populating a Class with Instances/Postgres Docs
Content-Type: multipart/mixed; boundary="------------94DCEB307A2D80B4A882B9D0"
This is a multi-part message in MIME format.
--------------94DCEB307A2D80B4A882B9D0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Hi there,
I hope I'm using the correct address for this. If not, would you please
so kind to redirect me to the correct address, if possible?
The COPY statement in the attached query-ug2887.htm from the PostgreSQL
User's Guide is explain with a typo.
While it is written:
'COPY INTO weather FROM '/home/user/weather.txt'
USING DELIMITERS '|';'
the correct version must be without the 'INTO':
'COPY weather FROM '/home/user/weather.txt'
USING DELIMITERS '|';'
It took me half an hour to look for COPY with \h COPY in psql instead of
trusting the web documentation :-(
Greetings from Hannover, Germany and thanks for your work on Postgres!
Georg
--
Georg Vollmers, M.A., HDI V.a.G., Zentrale Informationsverarbeitung,
Verfahrenstechnik, Phone +49 511 6454854 Fax +49 511 645114854
email: Vollmers@HDI.de, Georg.Vollmers@Z.HDI.de
privat: georg@egalize.han.de
--------------94DCEB307A2D80B4A882B9D0
Content-Type: text/html; charset=us-ascii;
name="query-ug2887.htm"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="query-ug2887.htm"
Content-Base: "http://z1is321h/postgres/user/query-ug
2887.htm"
Content-Location: "http://z1is321h/postgres/user/query-ug
2887.htm"
Populating a Class with Instances
The insert statement is used to populate a class with
instances:
INSERT INTO weather
VALUES ('San Francisco', 46, 50, 0.25, '11/27/1994')
You can also use the copy command to perform load large
amounts of data from flat (ASCII) files.
This is usually faster because the data is read (or written) as a single atomic
transaction directly to or from the target table. An example would be:
COPY INTO weather FROM '/home/user/weather.txt'
USING DELIMITERS '|';
where the path name for the source file must be available to the backend server
machine, not just the client.