Re: [PERFORM] Vs NULL

Поиск
Список
Период
Сортировка
От David G Johnston
Тема Re: [PERFORM] Vs NULL
Дата
Msg-id 1423544557197-5837308.post@n5.nabble.com
обсуждение исходный текст
Ответ на Re: [PERFORM] Vs NULL  (sridhar bamandlapally <sridhar.bn1@gmail.com>)
Список pgsql-admin
sridhar bamandlapally wrote
> In application code is
>
> while inserting/updating: INSERT/UPDATE into ... ( '' )  - which is empty
> string in PG, and in Oracle its NULL
>
> while selecting: SELECT ... WHERE column IS NULL / NOT NULL
>
> the issue is, while DML its empty string and while SELECT its comparing
> with NULL

If this is the extent of your problem then you can add table triggers to
change the empty-string input so that the result of the insert/update is
NULL.  Then all of your selects can use IS NULL for their comparisons just
like they do now.

That is as "implicit" as you are going to get without actually fixing the
underlying problem.

David J.






--
View this message in context: http://postgresql.nabble.com/empty-string-Vs-NULL-tp5837188p5837308.html
Sent from the PostgreSQL - admin mailing list archive at Nabble.com.


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

Предыдущее
От: Scott Ribe
Дата:
Сообщение: Re: [PERFORM] Vs NULL
Следующее
От: Harshad Adalkonda
Дата:
Сообщение: Re: How to upgrade psql client