record datatype comparisons - Mailing list pgsql-sql

From George Pavlov
Subject record datatype comparisons
Date
Msg-id 8C5B026B51B6854CBE88121DBF097A8655CBDD@ehost010-33.exch010.intermedia.net
Whole thread Raw
In response to Round Numeric Type  ("Ezequias Rodrigues da Rocha" <ezequias.rocha@gmail.com>)
Responses Re: record datatype comparisons
List pgsql-sql
I am trying to do some record comparisons using IS DISTINCT FROM and I
feel like I am missing something. Basically comparisons between manually
constructed records work as expected, but if I have a record returned by
a select on one (or both sides) of the comparison I get errors "ERROR:
operator does not exist: record = record". I suspect some simple missing
parentheses/syntax issue but I feel like I have tried everything...

The simplest way to reproduce:

select ((1::int,'a'::varchar) is distinct from (2::int,'a'::varchar));

--> true, as expected

select ((1::int,'a'::varchar) is distinct from (select
(2::int,'a'::varchar)));

--> throws the error

Both (1::int,'a'::varchar) and (select (2::int,'a'::varchar)) are of
type record, aren't they?

In real life I want the right side of the IS DISTINCT FROM to be the
result of a query to a table.

Please help. Thanks!

George


pgsql-sql by date:

Previous
From: "A. Kretschmer"
Date:
Subject: Re: Table Relationships
Next
From: "Aaron Bono"
Date:
Subject: Re: Table Relationships