Re: COPY FROM in psql

From: Rob Sargent <robjsargent(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: COPY FROM in psql
Date: 2012-11-20 19:03:10
Message-ID: 50ABD3EE.60509@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 11/20/2012 11:47 AM, Matthew Vernon wrote:
> 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' ;
>
> I should also note that I want to run a series of these commands, hence
> setting pwd once and then wanting to use it multiple times.
>
> Matthew
>
Since you're resting the full path anyway, does this work?

\set pwd '\'' `pwd` '/rest/of/path\''

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2012-11-20 19:05:01 Re: COPY FROM in psql
Previous Message Matthew Vernon 2012-11-20 18:55:52 Re: COPY FROM in psql