Re: [ADMIN] <empty string> Vs NULL

From: Geoff Winkless <pgsqladmin(at)geoff(dot)dj>
To: sridhar bamandlapally <sridhar(dot)bn1(at)gmail(dot)com>
Cc: "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org>, pgsql-performance <pgsql-performance(at)postgresql(dot)org>
Subject: Re: [ADMIN] <empty string> Vs NULL
Date: 2015-02-09 12:48:51
Message-ID: CAEzk6fefR6t0WACGX4-RsvZpwMYH2fsjWiXo2ML5gXoaUyL2+w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-performance

On 9 February 2015 at 11:22, sridhar bamandlapally <sridhar(dot)bn1(at)gmail(dot)com>
wrote:

> the issue we are facing is <empty string> Vs NULL
>
> In Oracle '' (<empty string>) and NULL are treated as NULL
>
> but, in PostgreSQL '' <empty string> not treated as NULL
>
> I need some *implicit* way in PostgreSQL where ''<empty string> can be
> treated as NULL
>
>

The Right Thing to do is to fix your application, and don't use broken
DBMSes: NULL should not denote anything except "this value is not set". If
you count an empty string as null, how do you represent the empty string?

Oracle's own documentation suggests that developers should not rely on this
behaviour since it may change in the future.

So Do The Right Thing now, and you won't get bitten later.

Geoff​

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Geoff Winkless 2015-02-09 12:57:19 Re: <empty string> Vs NULL
Previous Message Nicolas Paris 2015-02-09 12:45:38 Re: Change postgresql encoding

Browse pgsql-performance by date

  From Date Subject
Next Message Geoff Winkless 2015-02-09 12:57:19 Re: <empty string> Vs NULL
Previous Message Marc Mamin 2015-02-09 12:42:29 Re: [PERFORM] <empty string> Vs NULL