X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id EBF1FD1C7EB for ; Wed, 6 Aug 2003 14:03:40 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 35640-02 for ; Wed, 6 Aug 2003 11:02:23 -0300 (ADT) Received: from mail1.dr.myx.net (mail1.dr.myx.net [217.10.193.161]) by svr1.postgresql.org (Postfix) with ESMTP id A3D63D1C518 for ; Wed, 6 Aug 2003 11:03:28 -0300 (ADT) Received: from workstation24 (unknown [81.12.137.146]) by mail1.dr.myx.net (mydomain.myx.net) with ESMTP id 252373005E2; Wed, 6 Aug 2003 17:03:27 +0300 (EEST) Message-ID: <161701c35c23$508b8f00$0600a8c0@fix.ro> From: "Viorel Dragomir" To: "Jodi Kanter" , "Postgres SQL List" References: <3F310BA1.2010701@virginia.edu> Subject: Re: looking for empty fields Date: Wed, 6 Aug 2003 17:02:02 +0300 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_1614_01C35C3C.74AD3F50" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests=ASCII_FORM_ENTRY, BAYES_30, HTML_60_70, REFERENCES X-Spam-Level: X-Archive-Number: 200308/49 X-Sequence-Number: 14665 This is a multi-part message in MIME format. ------=_NextPart_000_1614_01C35C3C.74AD3F50 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable ________________________________ ----- Original Message -----=20 From: Jodi Kanter=20 To: Postgres SQL List=20 Sent: Wednesday, August 06, 2003 5:07 PM Subject: [SQL] looking for empty fields We recently upgraded from version 7.2.3 to 7.3.3 and seem to have some co= de that has broken. We were doing checks in various locations looking for n= ulls and/or empty fields. To search for empty fields we said something like= =20 select count(am_pk) from arraymeasurement where al_fk is null or al_fk=3D= ''; It's a string value that you're searching for? If not, don't use ''. Is this not allowed anymore? All my check with the double ticks are faili= ng. I assume there is a difference in postgres between an empty and null fi= eld. How can I check for both in 7.3.3? Thanks Jodi --=20 _______________________________ Jodi L Kanter BioInformatics Database Administrator University of Virginia (434) 924-2846 jkanter@virginia.edu=20 ------=_NextPart_000_1614_01C35C3C.74AD3F50 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable ________________________________
 
----- Original Message -----
Fro= m:=20 Jodi= =20 Kanter
Sent: Wednesday, August 06, 2003 5= :07=20 PM
Subject: [SQL] looking for empty= =20 fields

We recently upgraded from version 7.2.3 to 7.3.3 and seem to have so= me=20 code that has broken. We were doing checks in various locations looking f= or=20 nulls and/or empty fields. To search for empty fields we said something l= ike=20

select count(am_pk) from arraymeasurement where al_fk is null or= =20 al_fk=3D'';
 
It's a string value that you're = searching=20 for?
If not, don't use ''.


Is this not allowed anymo= re? All=20 my check with the double ticks are failing. I assume there is a differenc= e in=20 postgres between an empty and null field. How can I check for both in=20 7.3.3?
Thanks
Jodi
--

____________________________= ___
Jodi L Kanter
BioInformatics Database=20 Administrator
University of Virginia
(434) 924-2846
jkanter@virginia.edu
= <!--[if=20 !supportLineBreakNewLine]--><!--[endif]-->

<!--[if=20 !supportEmptyParas]-->  <!--[endif]-->

<!--[if=20 !supportEmptyParas]-->  <!--[endif]-->

<!--[if=20 !supportEmptyParas]-->=20  <!--[endif]-->

------=_NextPart_000_1614_01C35C3C.74AD3F50--