Re: [GENERAL] Import data from a file

From: Peter Eisentraut <e99re41(at)DoCS(dot)UU(dot)SE>
To: datab(at)main(dot)kenken(dot)ro
Cc: pgsql-general(at)postgreSQL(dot)org
Subject: Re: [GENERAL] Import data from a file
Date: 1999-10-25 13:16:48
Message-ID: Pine.GSO.4.02A.9910251511520.7688-100000@Hjort.DoCS.UU.SE
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, 25 Oct 1999 datab(at)main(dot)kenken(dot)ro wrote:

> How can I import data from a file into existing table?

Contrary to what some other people have said (and will say) you perhaps
cannot use the copy command, since it can only read in files on the same
file system as the database server. There is the psql \copy command which
is a wrapper around the backend's copy but will act on the client's file
system.

In general your existing file has to be very carefully crafted to work
right with either copy incarnation. If it isn't I'd personally go for a
Perl script, but any other higher level language would do.

-Peter

--
Peter Eisentraut Sernanders vaeg 10:115
peter_e(at)gmx(dot)net 75262 Uppsala
http://yi.org/peter-e/ Sweden

In response to

Browse pgsql-general by date

  From Date Subject
Next Message soundar rajan 1999-10-25 14:22:12 retrieving last 3 rows
Previous Message amy cheng 1999-10-25 13:05:42 current_timestamp and default now()