Re: Pgsql dynamic statements and null values

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: Pgsql dynamic statements and null values
Дата
Msg-id 20050309105046.GD1239@svana.org
обсуждение исходный текст
Ответ на Pgsql dynamic statements and null values  ("Guy Rouillier" <guyr@masergy.com>)
Список pgsql-general
On Tue, Mar 08, 2005 at 04:30:54PM -0600, Guy Rouillier wrote:
> This is such a common usage pattern that I'm pretty sure I'm missing
> something basic.  Pgsql provides quote_literal to aid with inserting a
> literal string into a dynamically prepared statement.  My opinion is
> that quote_literal should handle nulls as well, but if quote_literal
> can't be changed for historical reasons, then providing another function
> like check_null below would be very useful.  Basically, such a function
> should supply the value NULL if the incoming value is null, or the
> incoming value otherwise.

Lookup the COALESCE and NULLIF functions.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

Вложения

В списке pgsql-general по дате отправления:

Предыдущее
От: Alban Hertroys
Дата:
Сообщение: Re: Disabling triggers in a transaction
Следующее
От: Howard Cole
Дата:
Сообщение: Re: postgresql vs mysql performance comparison