Re: 8.3 PLpgSQL Can't Compare Records? - Mailing list pgsql-hackers

From David E. Wheeler
Subject Re: 8.3 PLpgSQL Can't Compare Records?
Date
Msg-id 95EEDB4E-CAB0-43DB-A4C0-DA41D388D9F0@kineticode.com
Whole thread Raw
In response to Re: 8.3 PLpgSQL Can't Compare Records?  (Merlin Moncure <mmoncure@gmail.com>)
List pgsql-hackers
On Jul 1, 2009, at 11:47 AM, Merlin Moncure wrote:

>> fyi: works in 8.4, as part of a broad fix of composite type  
>> comparison ops
>
> whoops, you knew that already :-).  one possible workaround is:
>
> select $1::text is distinct from $2::text

Yes, and that's what I'm doing, although it is significantly less  
precise, in that:

* Columns with different types may successfully compare (e.g., NULL  
and '')
* No (easy) way to tell if two records have different numbers of columns

But it's good enough for 8.3 if there is no other workaround.

Thanks,

David


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: 8.5 development schedule
Next
From: Lorraine Mancuso
Date:
Subject: resetxlog bug