Matthew Vernon <matthew.vernon@sac.ac.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?
\copy table from 'relative/path/to/data'
The server-side COPY is likely to give you a lot of permission
headaches, ie the server's userid will need to be able to read that
file and the directories above it.
If you really need to do this I'd suggest doing the path-stitching
in the \set:
\set target '\'' `pwd` '/relative/path/to/data\''
COPY table FROM :target ;
regards, tom lane