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