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

Re: 8.3 PLpgSQL Can't Compare Records?

From: "David E(dot) Wheeler" <david(at)kineticode(dot)com>
To: Merlin Moncure <mmoncure(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: 8.3 PLpgSQL Can't Compare Records?
Date: 2009-07-01 19:36:21
Message-ID: 95EEDB4E-CAB0-43DB-A4C0-DA41D388D9F0@kineticode.com (view raw or flat)
Thread:
Lists: 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

In response to

pgsql-hackers by date

Next:From: Lorraine MancusoDate: 2009-07-01 20:19:48
Subject: resetxlog bug
Previous:From: Bruce MomjianDate: 2009-07-01 18:49:12
Subject: Re: 8.5 development schedule

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group