Re: Feature request: include script file into function body

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: Feature request: include script file into function body
Дата
Msg-id AANLkTi=7C8xFYF7uQW0y+si8oNdKoY2NX8jc4bU0GWvY@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Feature request: include script file into function body  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
Ответы Re: Feature request: include script file into function body  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
Re: Feature request: include script file into function body  (Steve White <swhite@aip.de>)
Список pgsql-bugs
On Tue, Feb 1, 2011 at 3:09 PM, Kevin Grittner
<Kevin.Grittner@wicourts.gov> wrote:
> Steve White <swhite@aip.de> wrote:
>> On =A01.02.11, Tom Lane wrote:
>>> "Kevin Grittner" <Kevin.Grittner@wicourts.gov> writes:
>>>> Maybe some option for the \i command? =A0\iq (for input quoted)
>>>> with automatic $$ quoting around what is read?
>>>
>>>> That way you could do something like:
>>>
>>>> CREATE FUNCTION yadda_yadda() returns text language plpythonu as
>>>> \iq yadda_yadda.py
>>>> ;
>>
>> Yes this will work for me.
>>
>>>
>>> Just got this --- looks like we independently arrived at the same
>>> conclusion.
>
> I'll add it to the TODO list. =A0It looks like we might finally have a
> good one for those looking for an easy item from that list. =A0Those
> have been scarce lately.

Can't you already do it this way:

\set yadda `cat yadda_yadda.py`
CREATE FUNCTION yadda_yadda() returns text language plpythonu AS
:'yadda';

I guess it probably won't work on Windows...

--=20
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

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

Предыдущее
От: "Kevin Grittner"
Дата:
Сообщение: Re: Feature request: include script file into function body
Следующее
От: "Kevin Grittner"
Дата:
Сообщение: Re: Feature request: include script file into function body