Re: SQL99 functions - Mailing list pgsql-hackers

From Thomas Lockhart
Subject Re: SQL99 functions
Date
Msg-id 3958AFF9.3FEECA64@alumni.caltech.edu
Whole thread Raw
In response to SQL99 functions  (Thomas Lockhart <lockhart@alumni.caltech.edu>)
Responses Re: SQL99 functions  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
> > 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


pgsql-hackers by date:

Previous
From: Philip Warner
Date:
Subject: Mailing List Archive Problem?
Next
From: Zeugswetter Andreas SB
Date:
Subject: AW: SQL99 functions