Re: quote_literal with NULL - Mailing list pgsql-hackers

From Simon Riggs
Subject Re: quote_literal with NULL
Date
Msg-id 1192007970.4233.167.camel@ebony.site
Whole thread Raw
In response to quote_literal with NULL  ("Brendan Jurd" <direvus@gmail.com>)
Responses Re: quote_literal with NULL
List pgsql-hackers
On Wed, 2007-10-10 at 14:57 +1000, Brendan Jurd wrote:

> Wouldn't it be more useful if quote_literal(NULL) yielded the text value 'NULL'?

I don't think you can change that now. There could be code out there
that relies on that behaviour.

It isn't very helpful to return the word NULL in many cases, since the
WHERE clause "col = NULL" does not do the same thing as "col is NULL".
So you need to know about NULL values and how to handle them in many
cases. 

It might be useful to define a new text concatenation operator ||| that
treats NULL values as zero-length strings, so that  'help ' ||| NULL ||| 'me' returns 'help me'

--  Simon Riggs 2ndQuadrant  http://www.2ndQuadrant.com



pgsql-hackers by date:

Previous
From: Dave Page
Date:
Subject: Re: Locale + encoding combinations
Next
From: Jan Wieck
Date:
Subject: Re: Skytools committed without hackers discussion/review