Re: [GENERAL] NEWBIE: How do I use \copy to populate from a flat file

From: "Gene Selkov Jr(dot)" <selkovjr(at)mcs(dot)anl(dot)gov>
To: pgsql-general(at)postgreSQL(dot)org
Subject: Re: [GENERAL] NEWBIE: How do I use \copy to populate from a flat file
Date: 1999-03-02 19:00:21
Message-ID: 199903021958.NAA00711@mail.xnet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


> I also think the ticks that Michael is talking about are required. You can
> usually find more information about the "copy" error in the server.log
> (don't know where this is located on your system).

The file name must be enclosed in single closing quotes ('\047'). And
by the way, psql (if built with readline library) allows emacs-style
command line editing and can complete file names like bash does (I am
also wondering if it's possible to improve it to complete SGL keywords
and table names). I always use completion to make sure the file exists
and is accessible:

copy ENTRY from '/u1
<TAB>w
copy ENTRY from '/u1/w
<TAB>
copy ENTRY from '/u1/www/
<TAB><TAB> to see choices
....

';<CR>

BTW, what did you mean by '\copy'?

--Gene

Browse pgsql-general by date

  From Date Subject
Next Message Chucka 1999-03-02 20:38:54 Broken Pipe?
Previous Message Gene Selkov Jr. 1999-03-02 18:36:50 Re: [SQL] FW: indexing functions