Re: Function with COPY command?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Function with COPY command?
Дата
Msg-id 19787.1181851186@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Function with COPY command?  (Warren <warren@clarksnutrition.com>)
Ответы Re: Function with COPY command?  ("Shoaib Mir" <shoaibmir@gmail.com>)
Список pgsql-general
Warren <warren@clarksnutrition.com> writes:
> Is there any way to make this function work?

> CREATE OR REPLACE FUNCTION import_text_file(char(255)) RETURNS void AS $$
> DECLARE
>      filename ALIAS FOR $1;
> BEGIN
>      COPY table FROM filename;
> END;
> $$ LANGUAGE plpgsql;

Use EXECUTE.

            regards, tom lane

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

Предыдущее
От: Dániel Dénes
Дата:
Сообщение: UNION ALL with the same ORDER BY on the parts and the result
Следующее
От: Scott Marlowe
Дата:
Сообщение: Re: COPY Command and a non superuser user?