How to use slash commands in a function

Поиск
Список
Период
Сортировка
От vanessa
Тема How to use slash commands in a function
Дата
Msg-id 8997475.post@talk.nabble.com
обсуждение исходный текст
Ответы Re: How to use slash commands in a function  (Alvaro Herrera <alvherre@commandprompt.com>)
Список pgsql-general
Hi guys,

I was wondering how could i (if at all possible) to use say a command like:
\! touch fred.txt     in a function?
i.e.

CREATE FUNCTION myfunc() RETURNS TRIGGER AS
'BEGIN
        \! touch fred.txt
         RETURN NEW;
END;'
LANGUAGE 'plpgsql';

At the moment i get:
ERROR: syntax error at or near "\"
Does this mean i should encapsulate the line in quotation marks or something
like that?

Cheers.
Vanessa


--
View this message in context: http://www.nabble.com/How-to-use-slash-commands-in-a-function-tf3237240.html#a8997475
Sent from the PostgreSQL - general mailing list archive at Nabble.com.


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

Предыдущее
От: Kenneth Downs
Дата:
Сообщение: Re: ROLE INHERIT
Следующее
От: Casey Duncan
Дата:
Сообщение: Re: Where art thou pg_clog?