Re: Suggestions please: names for function cachabilityattributes

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: mlw <markw(at)mohawksoft(dot)com>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Suggestions please: names for function cachabilityattributes
Date: 2002-04-03 23:19:31
Message-ID: Pine.LNX.4.30.0204031812550.684-100000@peter.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

Tom Lane writes:

> Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> > It could also be considered deterministic, strict, cacheable,
> > mathematically sensible, real, pleasant, or good. ;-)
>
> > Out of those, I believe "const" is the worst term, because saying "sin(x)
> > is a constant function" sounds pretty wrong.
>
> Yeah, that was my problem with "const" too. But "deterministic" has the
> same problem --- in the ordinary meaning of the term, a function doesn't
> become nondeterministic just because it depends on SET TIMEZONE as well
> as its explicit parameters. It's also too long and too hard to spell
> correctly ;-).

As it turns out, Oracle, IBM, and Microsoft use it for exactly the same
purpose, and it is standard ...

If you're not happy with labelling case 2 nondeterministic, add an
additional clause, like USES EXTERNAL STATE. We could dig through all the
adjectives in the world, but I don't think any will catch the situation
quite like saying what's actually going on.

> So far the only suggestion I've seen that really makes me happy is
> "volatile" for case 3.

Volatile means "subject to rapid or unexpected change", which is not
really what case 3 is.

> Brad's idea of "invariant" for case 1 isn't too bad, but as a partner
> for "cacheable" it seems a bit weak; if you haven't looked at the
> manual lately, will you remember which is which?

Actually, IBM has VARIANT as an alias for NOT DETERMINISTIC (and NOT
VARIANT for DETERMINISTIC).

--
Peter Eisentraut peter_e(at)gmx(dot)net

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Paul M Foster 2002-04-03 23:24:07 Re: Postgres and Foxbase
Previous Message Morrison, Trevor (Trevor) 2002-04-03 23:18:55 [NOVICE] readline and psql

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2002-04-03 23:57:46 Re: Locale support is now on by default
Previous Message Peter Eisentraut 2002-04-03 22:55:44 Re: Locale support is now on by default