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

using psql \copy command

From: David Bear <David(dot)Bear(at)asu(dot)edu>
To: pgsql-admin(at)postgresql(dot)org
Subject: using psql \copy command
Date: 2004-11-08 23:47:43
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-admin
I'm getting fairly frustrated here. I'm trying to populate a table
using psql copy command. The file lives in the client machine where
psql is running, not on the back end. I assume from the readings that
I can you the \copy command to get to data in my clients file system.
Yet, its not working.. Here are  the commands:

iddwb(at)moroni:~/data/copp/dev/npcenter> ls -l
total 231
-rw-r--r--    1 3117  iddwb  88979 2004-11-08 16:32 contactName.txt
-rw-------    1 3117  iddwb  145024 2004-11-08 16:09 tblContactNames.txt

psql -p 5432 -h localhost npcenter -U david

npcenter=> \copy "contactName" from "/home/iddwb/data/copp/dev/npcenter/contact
"/home/iddwb/data/copp/dev/npcenter/contactName.txt": No such file or

npcenter=> \copy "contactName" from "./contactName.txt" 
"./contactName.txt": No such file or directory

I must be missing something very obvious.. Help...

David Bear
phone: 	480-965-8257
fax: 	480-965-9189
College of Public Programs/ASU
Wilson Hall 232
Tempe, AZ 85287-0803
 "Beware the IP portfolio, everyone will be suspect of trespassing"

pgsql-admin by date

Next:From: Tom LaneDate: 2004-11-08 23:57:58
Subject: Re: [PERFORM] poor performance in migrated database
Previous:From: David BearDate: 2004-11-08 23:44:34
Subject: using psql copy command

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