Re: COPY FROM in psql

From: Matthew Vernon <matthew(dot)vernon(at)sac(dot)ac(dot)uk>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: COPY FROM in psql
Date: 2012-11-20 18:55:52
Message-ID: 87lidwt87f.fsf@macbeth.sac.ac.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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' ;

so I could do:

\set path '\'' `pwd` '/path/to/data1' '\''
COPY table1 FROM :path;

\set path '\'' `pwd` '/path/to/data2' '\''
COPY table2 FROM :path;

...but surely there's a better way?

Matthew

--
Matthew Vernon
Quantitative Veterinary Epidemiologist
Epidemiology Research Unit, SAC Inverness

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Rob Sargent 2012-11-20 19:03:10 Re: COPY FROM in psql
Previous Message Matthew Vernon 2012-11-20 18:47:48 Re: COPY FROM in psql