Re: PG 7.2b4 bug?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Don Baccus <dhogaza(at)pacifier(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: PG 7.2b4 bug?
Date: 2001-12-17 21:44:47
Message-ID: 7205.1008625487@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Don Baccus <dhogaza(at)pacifier(dot)com> writes:
> Maybe the behavior's implementation defined ... if not, I'd presume SQL3
> states that a function in the above context is called either once per
> row or once per query, not sometimes one or sometimes the other.

AFAICT, the relevant concept in SQL99 is whether a function is
"deterministic" or not:

An SQL-invoked routine is either deterministic or possibly non-
deterministic. An SQL-invoked function that is deterministic always
returns the same return value for a given list of SQL argument
values. An SQL-invoked procedure that is deterministic always
returns the same values in its output and inout SQL parameters
for a given list of SQL argument values. An SQL-invoked routine
is possibly non-deterministic if, during invocation of that SQL-
invoked routine, an SQL-implementation might, at two different
times when the state of the SQL-data is the same, produce unequal
results due to General Rules that specify implementation-dependent
behavior.

It looks to me like the spec does NOT attempt to nail down the behavior
of non-deterministic functions; in the places where they talk about
non-deterministic functions at all, it's mostly to forbid their use in
contexts where nondeterminism would affect the final result. Otherwise
the results are implementation-defined.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Don Baccus 2001-12-17 21:46:06 Re: recursive SQL functions
Previous Message Stephan Szabo 2001-12-17 21:36:19 Re: PG 7.2b4 bug?