NULL safe equality operator - Mailing list pgsql-hackers

From Christopher Kings-Lynne
Subject NULL safe equality operator
Date
Msg-id 43867454.6090105@familyhealth.com.au
Whole thread Raw
Responses Re: NULL safe equality operator  (Michael Glaesemann <grzm@myrealbox.com>)
Re: NULL safe equality operator  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Hi guys,

Does anyone know how I'd go about implementing the following MySQL 
operator in PostgreSQL?

---

NULL-safe equal. This operator performs an equality comparison like the 
=  operator, but returns 1 rather than NULL if both operands are NULL, 
and 0 rather than NULL if one operand isNULL.

mysql> SELECT 1 <=> 1, NULL <=> NULL, 1 <=> NULL;        -> 1, 1, 0
mysql> SELECT 1 = 1, NULL = NULL, 1 = NULL;        -> 1, NULL, NULL

---

Chris



pgsql-hackers by date:

Previous
From: Qingqing Zhou
Date:
Subject: Re: gprof SELECT COUNT(*) results
Next
From: Michael Glaesemann
Date:
Subject: Re: NULL safe equality operator