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

Re: local disk access for a remote psql connection

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: P Kapat <kap4lin(at)gmail(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: local disk access for a remote psql connection
Date: 2009-03-31 00:07:40
Message-ID: 26273.1238458060@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-novice
P Kapat <kap4lin(at)gmail(dot)com> writes:
> ... Now I want to copy a csv file, which is on the
> local client machine, into a table on the remote server machine. I try
> to do so via:

> COPY  myschm.mytb  FROM  '/home/myuser/myfile.csv'  WITH CSV header
> QUOTE AS '\"';

> which clearly doesn't work, giving: ERROR:  could not open file ......
> No such file or directory

Of course it won't work; that command reads files on the server's
filesystem.  Use psql's \copy command to copy files from/to the client
filesystem.

			regards, tom lane

In response to

pgsql-novice by date

Next:From: Lonni J FriedmanDate: 2009-03-31 03:24:32
Subject: performance: delete+insert versus update
Previous:From: P KapatDate: 2009-03-30 23:53:00
Subject: local disk access for a remote psql connection

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