Re: SQL99 functions

From: Thomas Lockhart <lockhart(at)alumni(dot)caltech(dot)edu>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Hackers List <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: SQL99 functions
Date: 2000-06-27 13:45:29
Message-ID: 3958AFF9.3FEECA64@alumni.caltech.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Zeugswetter Andreas SB 2000-06-27 13:52:01 AW: Proposal: More flexible backup/restore via pg_dump
Previous Message Giles Lean 2000-06-27 13:40:37 Re: Proposal: More flexible backup/restore via pg_dump