Re: [PERFORM] Vs NULL - Mailing list pgsql-admin

From David G Johnston
Subject Re: [PERFORM] Vs NULL
Date
Msg-id 1423544557197-5837308.post@n5.nabble.com
Whole thread Raw
In response to Re: [PERFORM] Vs NULL  (sridhar bamandlapally <sridhar.bn1@gmail.com>)
List 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 by date:

Previous
From: Scott Ribe
Date:
Subject: Re: [PERFORM] Vs NULL
Next
From: Harshad Adalkonda
Date:
Subject: Re: How to upgrade psql client