> > I see mention in SQL99 of function definitions which can have IN,
> > OUT, and INOUT arguments. Any thoughts on how this could be
> > supported in Postgres?
> I noticed that but haven't quite figured out how it's supposed to fit
> into the SQL worldview at all. Surely
> SELECT foo(x) FROM table
> shouldn't silently mutate into an UPDATE depending on how foo() is
> declared. Exactly where is a function with OUT args useful in SQL?
create table t1 (x int); create function foo (out int) returns int as ...; select foo(x) from t1;
will give two columns for the result.
create function foo (inout int) returns int as ...; select foo(x) from t1;
will mutate the result, but not the underlying stored value of t1.x.
Beware, I haven't yet confirmed this by reading ;)
- Thomas