How use input parameter as path to COPY in function?

Поиск
Список
Период
Сортировка
От Bill Todd
Тема How use input parameter as path to COPY in function?
Дата
Msg-id 4B0DF05E.9000909@dbginc.com
обсуждение исходный текст
Ответы Re: How use input parameter as path to COPY in function?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
I am missing something basic. How can I  use an input parameter as the
destination path in a COPY statement in a function. The following fails
with a syntax error at or near the parameter.

CREATE OR REPLACE FUNCTION  dvd.export_tables(IN export_path text)
RETURNS void
AS
$$
BEGIN
  copy dvd.genre to export_path
  with
  delimiter as E'\t'
  null as '';
END;
$$
  LANGUAGE 'plpgsql' VOLATILE




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

Предыдущее
От: Craig Ringer
Дата:
Сообщение: Re: limiting resources to users
Следующее
От: Tom Lane
Дата:
Сообщение: Re: How use input parameter as path to COPY in function?