X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 14A08D1B49C for ; Thu, 11 Dec 2003 20:43:13 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 06774-08 for ; Thu, 11 Dec 2003 16:42:43 -0400 (AST) Received: from smtp-send.myrealbox.com (smtp-send.myrealbox.com [192.108.102.143]) by svr1.postgresql.org (Postfix) with ESMTP id 094C6D1DB81 for ; Thu, 11 Dec 2003 16:42:41 -0400 (AST) Received: from daithan.intranet.pspl.co.in shridhar_daithankar@smtp-send.myrealbox.com [202.54.11.72] by smtp-send.myrealbox.com with NetMail SMTP Agent $Revision: 3.46 $ on Novell NetWare via secured & encrypted transport (TLS); Thu, 11 Dec 2003 08:01:54 -0700 From: Shridhar Daithankar To: "Nagib Abi Fadel" , "generalpost" Subject: Re: Should we consider empty fields as NULL values when dealing with string columns ? Date: Thu, 11 Dec 2003 20:30:15 +0530 User-Agent: KMail/1.5.4 References: <001401c3bff4$49abd7f0$f664a8c0@nagib> In-Reply-To: <001401c3bff4$49abd7f0$f664a8c0@nagib> MIME-Version: 1.0 Content-Type: text/plain; charset="windows-1256" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200312112030.15560.shridhar_daithankar@myrealbox.com> X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200312/655 X-Sequence-Number: 54049 On Thursday 11 December 2003 20:06, Nagib Abi Fadel wrote: > HI, > let's say we have the following table : > > # CREATE TABLE tempo (col1 varchar(3) not null); > CREATE TABLE > > # insert INTO tempo VALUES (''); > INSERT 11420541 1 > > the insert command works. > > The issue is that since the column col1 is defined as character with not > null attribute, shouldn't we deny such inserts (i mean inserting empty > fields)??? > (PS: i am using postresql 7.3.2) No. Because an empty string is not null. If you want it to work the way you describe, I believe you need to set transform_null_equals to true in postgresql.conf Check if postgresql7.3.2 supports it. But remember, relying on this variable is not recommended. Probably you should use indicator variables if php supports it. HTH Shridhar