Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

record datatype comparisons



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



Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group