Re: plpgsql - can't get a simple block to execute

Поиск
Список
Период
Сортировка
Искать
От
Tom Lane
Тема
Re: plpgsql - can't get a simple block to execute
Дата
Msg-id
26649.1112728840@sss.pgh.pa.us
Ответ на
Список
Дерево обсуждения
Re: plpgsql - can't get a simple block to execute "Walker, Jed S" <Jed_Walker@cable.comcast.com>
"Walker, Jed S"  writes:
>> This should be simple, but it's not. I think I'm just missing something
>> simple.  I converted an oracle PL/SQL program to plpgssql, but it wouldn't
>> work, so I tried some very simple blocks, and even they fail. As far as I
>> can tell, the syntax is all valid.

You can't just type plpgsql statements at the SQL interpreter ... it's a
different language.  You have to wrap those statements within a function
definition.  (This is unlike Oracle, I believe, which does think it's
all one language.  PG keeps a strong separation because it supports more
than one function programming language.)

Also, don't forget you have to install plpgsql support into each
database you want to use it in; it's not enabled by default, due to
probably-overly-paranoid security concerns.  See the "createlang" shell
script for the easy way to do this.

			regards, tom lane
В списке pgsql-novice по дате отправления
От: Celia McInnis
Дата:
От: Michael Fuhr
Дата:
FAQ