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

copy command

From: "Jose' Soares Da Silva" <sferac(at)bo(dot)nettuno(dot)it>
To: hackers postgres <pgsql-hackers(at)PostgreSQL(dot)org>
Cc: questions postgres <pgsql-questions(at)PostgreSQL(dot)org>
Subject: copy command
Date: 1998-04-28 16:18:26
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
Hi, all

PostgreSQL has two COPY commands to import/export data;

     copy [binary] <class_name> [with oids]
        {to|from} {<filename>|stdin|stdout} [using delimiters <delim>];

     \copy table {from | to} <fname>
both of them work in a different way;
     In the first one you have to specify 'filename' surrounded by ''
     and if you don't specify an absolute pathname PostgreSQL uses

     In the last one you have to specify 'filename' without by ''
     and if you don't specify an absolute pathname PostgreSQL uses
     current working directory.
     and last...  if you don't specify any parameter it show me this:

java=> \copy
connecting to new database: opy
PQexec() -- There is no connection to the backend.

Could not connect to new database. exiting

My question is:
       Why do we have two commands to doing the same operation ?
       Why are they different ?

                                                            Thanks, Jose'

pgsql-hackers by date

Next:From: Tom LaneDate: 1998-04-28 16:21:55
Subject: Revised proposal for libpq and FE/BE protocol changes
Previous:From: Andreas ZeugswetterDate: 1998-04-28 16:10:34
Subject: AW: [HACKERS] Re: Bug#21681: postgresql: Doesn't allow granting to www-data

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