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: Pine.LNX.3.96.980428153736.1796A-100000@proxy.bazzanese.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
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>];
and...

\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
$PGDATA/base/<databasename>/<filename>

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'

Browse pgsql-hackers by date

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