Re: IS OF - Mailing list pgsql-hackers

From Joe Conway
Subject Re: IS OF
Date
Msg-id 3E7D081F.7000705@joeconway.com
Whole thread Raw
In response to Re: IS OF  (Gavin Sherry <swm@linuxworld.com.au>)
Responses Re: IS OF  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-hackers
Gavin Sherry wrote:
> 
> 8.14 <type predicate> to be exact.
> 

8.18 in SQL200x. I don't think the current implementation quite meets 
the spec however:

regression=# select f2 is null, f2 is of(int) from bar; ?column? | ?column?
----------+---------- f        | t t        | t
(2 rows)

If I read the spec correctly, the null value should return null, not 't' 
in the above.

General Rules
1) Let V be the result of evaluating the <row value predicand>.
2) Let ST be the set consisting of every type that is either some   exclusively specified type, or a subtype of some
inclusively  specified type.
 
3) Let TPR be the result of evaluating the <type predicate>.

Case:
a) If V is the null value, then TPR is Unknown.
b) If the most specific type of V is a member of ST, then TPR is True .
c) Otherwise, TPR is False

Probably best not to document it until someone gets around to fixing it 
-- I can do it, but not for the next few weeks at least.

Joe



pgsql-hackers by date:

Previous
From: Gavin Sherry
Date:
Subject: Re: IS OF
Next
From: Neil Conway
Date:
Subject: Re: cursors: SCROLL default, error messages