pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: David G Johnston <david.g.johnston@gmail.com>
To: pgsql-admin@postgresql.org
Subject: Re: [PERFORM] <empty string> Vs NULL
Date: Mon, 9 Feb 2015 22:02:37 -0700 (MST)
Message-ID: <1423544557197-5837308.post@n5.nabble.com> (raw)
In-Reply-To: <CAGuFTBXaMmPuY8H1pFGvJWA=tUiTM0g92=_a8eHA=ACQmjEikA@mail.gmail.com>
References: <CAGuFTBWoL76nZ-DJqjX4aTyR0i5zJT+1KOFpe0-VTFB3y3DPtw@mail.gmail.com>
	<CAFj8pRCg0qbpwGBwG2fqzDo=JRkWROVRpoOuPsNUtOTdtOGUqA@mail.gmail.com>
	<B6F6FD62F2624C4C9916AC0175D56D8828B5B4AA@jenmbs01.ad.intershop.net>
	<B6F6FD62F2624C4C9916AC0175D56D8828B5B4D1@jenmbs01.ad.intershop.net>
	<CAGuFTBXaMmPuY8H1pFGvJWA=tUiTM0g92=_a8eHA=ACQmjEikA@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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.


-- 
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin



view thread (13+ messages)  latest in thread

Message-ID: <1423544557197-5837308.post@n5.nabble.com>
Permalink:  ../1423544557197-5837308.post@n5.nabble.com/
Also on:    postgresql.org/message-id/1423544557197-5837308.post@n5.nabble.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: david.g.johnston@gmail.com, pgsql-admin@postgresql.org
  Subject: Re: [PERFORM] <empty string> Vs NULL
  In-Reply-To: <1423544557197-5837308.post@n5.nabble.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox