Re: comparing rows

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: comparing rows
Дата
Msg-id 3491.965266598@sss.pgh.pa.us
обсуждение исходный текст
Ответ на comparing rows  (Tatsuo Ishii <t-ishii@sra.co.jp>)
Список pgsql-hackers
Tatsuo Ishii <t-ishii@sra.co.jp> writes:
> test=# select (1,2,null) = (1,2,null);
> ERROR:  Unable to identify an operator '=' for types 'unknown' and 'unknown'
>     You will have to retype this query using an explicit cast

Well, there's no basis for deciding what the datatype of the third
column is.

The only reason you don't get the same error from the non-row case

regression=# select null = null;?column?
----------t
(1 row)

is that we have an ugly, horrible kluge in the parser to (mis) interpret
"foo = null" as meaning "foo ISNULL", in order to be compatible with
broken Microsoft SQL implementations.  If you try any other operator
you get

regression=# select null <> null;
ERROR:  Unable to identify an operator '<>' for types 'unknown' and 'unknown'       You will have to retype this query
usingan explicit cast
 

I'd certainly not vote to propagate the "= null" kluge into the
row-equality code...
        regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tatsuo Ishii
Дата:
Сообщение: comparing rows
Следующее
От: Thomas Swan
Дата:
Сообщение: Re: random() function produces wrong range