Re: when does a function name get mapped to an OID?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: when does a function name get mapped to an OID?
Дата
Msg-id 8219.1019586609@sss.pgh.pa.us
обсуждение исходный текст
Ответ на when does a function name get mapped to an OID?  (Fran Fabrizio <ffabrizio@mmrd.com>)
Список pgsql-general
Fran Fabrizio <ffabrizio@mmrd.com> writes:
> I was noticing that within one of the files, something like this is
> declared:

> drop function bar();
> drop function foo();
> create function foo() returns int4 as '
>     select bar();
> ' language 'sql';
> create function bar() returns int4 as '
>    select 1234;
> ' language 'sql';

> This loads into the db just fine.

It does?

regression=# create function foo() returns int4 as '
regression'#     select bar();
regression'# ' language 'sql';
ERROR:  Function 'bar()' does not exist
        Unable to identify a function that satisfies the given argument types
        You may need to add explicit typecasts

The SQL language differs from the other ones in that it tries to
syntax-check the function body at CREATE time.  Perhaps this
inconsistency is not good, but that's how it's been for a long time.
You *can* get away with the above practice in the PL languages.

            regards, tom lane

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

Предыдущее
От: Darren Ferguson
Дата:
Сообщение: Re: when does a function name get mapped to an OID?
Следующее
От: "Cornelia Boenigk"
Дата:
Сообщение: PostgreSQL and bytea