Re: quote_literal with NULL

Поиск
Список
Период
Сортировка
От Simon Riggs
Тема Re: quote_literal with NULL
Дата
Msg-id 1192007970.4233.167.camel@ebony.site
обсуждение исходный текст
Ответ на quote_literal with NULL  ("Brendan Jurd" <direvus@gmail.com>)
Ответы Re: quote_literal with NULL  ("Brendan Jurd" <direvus@gmail.com>)
Список 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 по дате отправления:

Предыдущее
От: Dave Page
Дата:
Сообщение: Re: Locale + encoding combinations
Следующее
От: Jan Wieck
Дата:
Сообщение: Re: Skytools committed without hackers discussion/review