pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedCOPY TO / COPY FROM
4+ messages / 3 participants
[nested] [flat]
* COPY TO / COPY FROM
@ 2005-09-23 11:48 Cédric Buschini <cbuschini@carax.com>
2005-09-23 12:02 ` Re: COPY TO / COPY FROM Aldor <an@mediaroot.de>
2005-09-23 13:47 ` Re: COPY TO / COPY FROM Michael Fuhr <mike@fuhr.org>
0 siblings, 2 replies; 4+ messages in thread
From: Cédric Buschini @ 2005-09-23 11:48 UTC (permalink / raw)
To: pgsql-admin@postgresql.org
Hi
Here I am again with my 'stupd' question
here is a script :
=====================
psql -h192.168.XXX.XXX -dDATABASE -Upostgres << EOF > /home/postgres/FILE
COPY TABLE TO stdout;
EOF
psql -h192.168.XXX.XXX -dDATABASE -Upostgres << EOF
COPY carax_exec_bck FROM '/home/postgres/FILE';
EOF
=======================
I got this error :
ERROR: could not open file "/home/postgres/FILE" for reading: No such
file or directory
????
thx
cedric
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: COPY TO / COPY FROM
2005-09-23 11:48 COPY TO / COPY FROM Cédric Buschini <cbuschini@carax.com>
@ 2005-09-23 12:02 ` Aldor <an@mediaroot.de>
2005-09-23 15:52 ` Re: [ADMIN] COPY TO / COPY FROM Aldor <an@mediaroot.de>
1 sibling, 1 reply; 4+ messages in thread
From: Aldor @ 2005-09-23 12:02 UTC (permalink / raw)
To: cbuschini@carax.com; +Cc: pgsql-admin@postgresql.org
Why you don't make:
COPY carax_exec_bck TO '/home/postgres/FILE';
?
Then you could also use something like....
COPY carax_exec_bck TO '/home/postgres/FILE' WITH BINARY;
etc.
Cédric Buschini wrote:
> Hi
>
> Here I am again with my 'stupd' question
>
> here is a script :
>
> =====================
> psql -h192.168.XXX.XXX -dDATABASE -Upostgres << EOF > /home/postgres/FILE
> COPY TABLE TO stdout;
> EOF
>
> psql -h192.168.XXX.XXX -dDATABASE -Upostgres << EOF
> COPY carax_exec_bck FROM '/home/postgres/FILE';
> EOF
> =======================
>
> I got this error :
> ERROR: could not open file "/home/postgres/FILE" for reading: No such
> file or directory
>
> ????
>
> thx
>
> cedric
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/docs/faq
>
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: [ADMIN] COPY TO / COPY FROM
2005-09-23 11:48 COPY TO / COPY FROM Cédric Buschini <cbuschini@carax.com>
2005-09-23 12:02 ` Re: COPY TO / COPY FROM Aldor <an@mediaroot.de>
@ 2005-09-23 15:52 ` Aldor <an@mediaroot.de>
0 siblings, 0 replies; 4+ messages in thread
From: Aldor @ 2005-09-23 15:52 UTC (permalink / raw)
To: cbuschini@carax.com; +Cc: pgsql-sql
> I kown I can use pg_dump to perform that "back up" but I wanted to
> test performences.
pg_dump does the same.. if you same custom it makes binary (WITH BINARY)
but with compression.
Performance?
1. TOP: inserte into select ....
2. TOP: copy / pg_restore with uncompressed binary
3. TOP: copy / pg_restore with uncompressed text
4. TOP: pg_restore with compressed binary (custom format in pg_dump)
5. TOP: normal inserts...
This is my experience.
> PATH = /home/postgres//carax_exec.out
Be aware to give postgres write/read access to this file/dir - i think
the double "//" is typee
Cédric Buschini wrote:
> Aldor wrote:
>
>> What is the name of the table you want to dump?
>>
>>
> I kown I can use pg_dump to perform that "back up" but I wanted to test
> performences.
>
> The table is carax_exec
>
>> What is the exact path you try to dump it to?
>>
>>
> PATH = /home/postgres//carax_exec.out
>
>> What version of PostgreSQL do you have?
>>
>>
> uhmm 8.0
>
>
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: COPY TO / COPY FROM
2005-09-23 11:48 COPY TO / COPY FROM Cédric Buschini <cbuschini@carax.com>
@ 2005-09-23 13:47 ` Michael Fuhr <mike@fuhr.org>
1 sibling, 0 replies; 4+ messages in thread
From: Michael Fuhr @ 2005-09-23 13:47 UTC (permalink / raw)
To: Cédric Buschini <cbuschini@carax.com>; +Cc: pgsql-admin@postgresql.org
On Fri, Sep 23, 2005 at 01:48:33PM +0200, Cédric Buschini wrote:
> =====================
> psql -h192.168.XXX.XXX -dDATABASE -Upostgres << EOF > /home/postgres/FILE
> COPY TABLE TO stdout;
> EOF
>
> psql -h192.168.XXX.XXX -dDATABASE -Upostgres << EOF
> COPY carax_exec_bck FROM '/home/postgres/FILE';
> EOF
> =======================
>
> I got this error :
> ERROR: could not open file "/home/postgres/FILE" for reading: No such
> file or directory
Are the client and server on the same machine? The use of the -h
option suggests perhaps not. In the first command you're redirecting
psql's output to a file on the client machine, and in the second
command you're trying to read a file on the server machine.
--
Michael Fuhr
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2005-09-23 15:52 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-09-23 11:48 COPY TO / COPY FROM Cédric Buschini <cbuschini@carax.com>
2005-09-23 12:02 ` Aldor <an@mediaroot.de>
2005-09-23 15:52 ` Aldor <an@mediaroot.de>
2005-09-23 13:47 ` Michael Fuhr <mike@fuhr.org>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox