COPY FROM in psql

Поиск
Список
Период
Сортировка
От Matthew Vernon
Тема COPY FROM in psql
Дата
Msg-id 87wqxgt8oo.fsf@macbeth.sac.ac.uk
обсуждение исходный текст
Ответы Re: COPY FROM in psql  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Hi,

suppose for a moment I want to write a psql script that loads some data
into a database. I don't want to write an absolute path into my script,
but merely know where the data file will be relative to my script
location.

naiively, you might try:
\set pwd '\'' `pwd` '\''
COPY table FROM :pwd || '/relative/path/to/data' ;

but that doesn't work because the concatenation operator can't be used
there. How should I be doing this?

Thanks,

Matthew

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


В списке pgsql-general по дате отправления:

Предыдущее
От: Merlin Moncure
Дата:
Сообщение: Re: High SYS CPU - need advise
Следующее
От: Matthew Vernon
Дата:
Сообщение: Re: COPY FROM in psql