agora inbox for pgsql-sql@postgresql.org  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: David W Noon <david.w.noon@googlemail.com>
To: pgsql-sql@postgresql.org
Subject: Re: NOT NULL CHECK (mycol !='') :good idea? bad idea?
Date: Fri, 3 Jun 2016 12:05:58 -0700
Message-ID: <aeb5d614-c77e-073c-e25a-4eb1dbfc3b7a@aklaver.com> (raw)
In-Reply-To: <5751D2C5.3080303@googlemail.com>
References: <CACpWLjPX-_80aXcJFbk7wxZWKPTs2Fyeywe=6HmgorzV2U=n7A@mail.gmail.com>
	<5751D2C5.3080303@googlemail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-sql>

On 06/03/2016 11:56 AM, David W Noon wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On Fri, 3 Jun 2016 11:16:33 -0700, Michael Moore
> (michaeljmoore@gmail.com) wrote about "[SQL] NOT NULL CHECK (mycol
> !='') :good idea? bad idea?" (in
> <CACpWLjPX-_80aXcJFbk7wxZWKPTs2Fyeywe=6HmgorzV2U=n7A@mail.gmail.com>):
>
>> In Oracle, a NOT NULL constraint on a table column of VARCHAR in
>> essence says: "You need to put at least 1 character for a value".
>> There is no such thing as a zero-length string in Oracle, it's
>> either NULL or it has some characters.
>
> So Oracle is not compliant with ANSI standard SQL.

Though it looks like they want to be:

http://docs.oracle.com/database/121/SQLRF/sql_elements005.htm#SQLRF30037

"Note:
Oracle Database currently treats a character value with a length of zero 
as null. However, this may not continue to be true in future releases, 
and Oracle recommends that you do not treat empty strings the same as 
nulls."





-- 
Adrian Klaver
adrian.klaver@aklaver.com


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



view thread (5+ messages)  latest in thread

Message-ID: <aeb5d614-c77e-073c-e25a-4eb1dbfc3b7a@aklaver.com>
Permalink:  ../aeb5d614-c77e-073c-e25a-4eb1dbfc3b7a@aklaver.com/
Also on:    postgresql.org/message-id/aeb5d614-c77e-073c-e25a-4eb1dbfc3b7a@aklaver.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-sql@postgresql.org
  Cc: adrian.klaver@aklaver.com, david.w.noon@googlemail.com
  Subject: Re: NOT NULL CHECK (mycol !='') :good idea? bad idea?
  In-Reply-To: <aeb5d614-c77e-073c-e25a-4eb1dbfc3b7a@aklaver.com>

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

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