Re: 8.0.3 regexp_replace()... - Mailing list pgsql-general

From Stephan Szabo
Subject Re: 8.0.3 regexp_replace()...
Date
Msg-id 20060201074535.A87739@megazone.bigpanda.com
Whole thread Raw
In response to Re: 8.0.3 regexp_replace()...  ("rlee0001" <robeddielee@hotmail.com>)
Responses Re: 8.0.3 regexp_replace()...  ("rlee0001" <robeddielee@hotmail.com>)
List pgsql-general
On Tue, 31 Jan 2006, rlee0001 wrote:

> I am suggesting that the behaviour of SUBSTRING returning NULL when no
> matches is found is either a bug in PostgreSQL or a flaw in the SQL
> specification. It is not logical.

No, but sadly it seems to be what the SQL spec wants for its similar
construct.

---

In general, SQL's handling of NULLs is badly designed.

Sometimes it's misused (like the substring case).

Sometimes it's confusing (like the IN and NOT IN cases).

Sometimes it's just bizarre.  If cardinality of a table expression is
important (ie, count(*) is meaningful), why is DISTINCT defined in a way
that basically does not give results consistent with NULL being unknown.
UNIQUE(q) should return NULL in the presence of NULLs rather than true,
since the real result is well, unknown (the two of these together have the
side effect of UNIQUE being true not guaranteeing that the cardinality of
a subquery and the subquery with distinct being the same).

---

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: 8.0.3 regexp_replace()...
Next
From: TJ O'Donnell
Date:
Subject: Re: Converting Text to Bytea