Re: COPY FROM in psql

From: Jasen Betts <jasen(at)xnet(dot)co(dot)nz>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: COPY FROM in psql
Date: 2012-11-23 10:05:53
Message-ID: k8nhq1$3oa$2@reversiblemaps.ath.cx
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 2012-11-21, Matthew Vernon <matthew(dot)vernon(at)sac(dot)ac(dot)uk> wrote:
> tgl(at)sss(dot)pgh(dot)pa(dot)us (Tom Lane) writes:
>
>> Matthew Vernon <matthew(dot)vernon(at)sac(dot)ac(dot)uk> writes:
>>> naiively, you might try:
>>> \set pwd '\'' `pwd` '\''
>>> COPY table FROM :pwd || '/relative/path/to/data' ;
>>
>> Umm ... why don't you just use a relative path as-is, with \copy
>> instead of COPY?
>
> Thanks for the suggestion, but I was avoiding \copy because the
> quantities of data involved are large, and the documentation suggests
> that COPY is better than \copy for large data volumes.

\copy is translated to "COPY .... FROM STDIN" by psql
performance should be almost as fast, you loose a little in the
buffering and re-streaming, but not much.

--
⚂⚃ 100% natural

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Peter Kroon 2012-11-23 10:09:36 Re: create table in memory
Previous Message Raghavendra 2012-11-23 09:49:13 Re: create table in memory