Peter Eisentraut <[EMAIL PROTECTED]> writes:
> Christopher Kings-Lynne wrote:
>> Needs to return 0 or 1 though.
> All Boolean operators in MySQL do that, so to create an illusion of
> MySQL compatibility, you'd need to redefine all standard Boolean
> operators. I don't think you want that.
Won
Christopher Kings-Lynne <[EMAIL PROTECTED]> writes:
>> test=# select null_safe_cmp (NULL,NULL);
>> ERROR: could not determine anyarray/anyelement type because input has
>> type "unknown"
>> Same casting problem due to anyelement, of course.
> Yes - I wonder what the trick to getting around that
Hello there,
I have included the ipv6 auth. line in my pg_hba.conf file(::1/128)
I keep getting error msgs from postmaster everytime I try to
connect.
Going by previous posts on the topic am unable to conclude.
Does this mean pg 8.0.3 doesn't support ipv6 client auth. ??
Or is there a patch som
Christopher Kings-Lynne wrote:
> Needs to return 0 or 1 though.
All Boolean operators in MySQL do that, so to create an illusion of
MySQL compatibility, you'd need to redefine all standard Boolean
operators. I don't think you want that.
--
Peter Eisentraut
http://developer.postgresql.org/~pet
On Nov 25, 2005, at 17:06 , Christopher Kings-Lynne wrote:
test=# select null_safe_cmp (NULL,NULL);
ERROR: could not determine anyarray/anyelement type because
input has type "unknown"
test=# select null_safe_cmp (NULL::integer,NULL::integer);
null_safe_cmp
---
1
(
CREATE OR REPLACE FUNCTION null_safe_cmp (ANYELEMENT, ANYELEMENT)
RETURNS INTEGER IMMUTABLE
LANGUAGE SQL AS $$
SELECT CASE
WHEN NOT ($1 IS DISTINCT FROM $2) THEN 1
ELSE 0
END;
$$;
Even cooler:
CREATE OR REPLACE FUNCTION null_safe_cmp(anyelement, anyelement)
RETURNS integer AS '
SELECT
test=# select null_safe_cmp (NULL,NULL);
ERROR: could not determine anyarray/anyelement type because input has
type "unknown"
test=# select null_safe_cmp (NULL::integer,NULL::integer);
null_safe_cmp
---
1
(1 row)
Same casting problem due to anyelement, of course.
Ye
On Nov 25, 2005, at 16:43 , Christopher Kings-Lynne wrote:
Yeah, I saw your commit. Nice shortcut. Also didn't know you
could define operators using SQL functions. Tom's suggestion of
NOT (a DISTINCT FROM b) is really cool. Much cleaner in my
opinion. I learn a lot from these lists :)
On Nov 25, 2005, at 16:37 , Michael Glaesemann wrote:
Tom's suggestion of NOT (a DISTINCT FROM b) is really cool.
Even cooler if I spell it correctly: NOT (a IS DISTINCT FROM b)
Michael Glaesemann
grzm myrealbox com
---(end of broadcast)---
Yeah, I saw your commit. Nice shortcut. Also didn't know you could
define operators using SQL functions. Tom's suggestion of NOT (a
DISTINCT FROM b) is really cool. Much cleaner in my opinion. I learn a
lot from these lists :)
Needs to return 0 or 1 though.
Chris
On Nov 25, 2005, at 16:24 , Christopher Kings-Lynne wrote:
when ($1 is null and $2 is not null)
or ($1 is not null and $2 is null) then 0
That's the same as:
when $1 is null != $2 is null then 0
Yeah, I saw your commit. Nice shortcut. Also didn't know you could
define operato
when ($1 is null and $2 is not null)
or ($1 is not null and $2 is null) then 0
That's the same as:
when $1 is null != $2 is null then 0
Chris
---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropri
On Thu, 24 Nov 2005, Tom Lane wrote:
> NOT (x IS DISTINCT FROM y) would be the standard-compliant way of
> spelling that.
That's the sql99 way. In sql2003 (but not in pg) one can also do
X IS NOT DISTINCT FROM y
--
/Dennis Björklund
---(end of broadcast)
Christopher Kings-Lynne <[EMAIL PROTECTED]> writes:
> Does anyone know how I'd go about implementing the following MySQL
> operator in PostgreSQL?
NOT (x IS DISTINCT FROM y) would be the standard-compliant way of
spelling that.
regards, tom lane
-
On Nov 25, 2005, at 11:17 , Christopher Kings-Lynne wrote:
Hi guys,
Does anyone know how I'd go about implementing the following MySQL
operator in PostgreSQL?
I'm sure you know how to implement this with a stored procedure.
AFAICT, if you wanted to actually implement this as an operator,
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
16 matches
Mail list logo