X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id EE080D1C919 for ; Fri, 1 Aug 2003 04:53:29 +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 16064-04 for ; Fri, 1 Aug 2003 01:52:23 -0300 (ADT) Received: from technet4.t-n-i.dmz (technet65.tnss.com [216.160.28.65]) by svr1.postgresql.org (Postfix) with ESMTP id 5EAA5D1C95A for ; Fri, 1 Aug 2003 01:53:27 -0300 (ADT) Received: from tnss.com (IDENT:maillist@technet2.t-n-i.dmz [10.254.254.2]) by technet4.t-n-i.dmz (8.11.6/8.11.6) with ESMTP id h714rwY24877 for ; Thu, 31 Jul 2003 23:53:58 -0500 Message-ID: <3F29F273.3A3B8137@tnss.com> Date: Thu, 31 Jul 2003 23:54:11 -0500 From: maillist X-Mailer: Mozilla 4.78 [en] (X11; U; Linux 2.4.18-27.7.xsmp i686) X-Accept-Language: en MIME-Version: 1.0 To: "pgsql-admin@postgresql.org" Subject: fyi Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/2 X-Sequence-Number: 9725 previous table definition guess no not null of default '' curreent table definitionCREATE TABLE apps ( Id int not null unique, -- AppId Sym varchar(8) not null default '', -- app symbol name Nam varchar(30) not null default '', -- app full name BitPriv varchar(10) not null default '', -- app bit priv NamPriv varchar(255) not null default '', -- app nam priv AppDir varchar(80) not null default '', -- app dir nam AppPag varchar(32), -- app page nam Aka int, -- ptr to real name Uid int not null default 0, -- ptr to las mod user id Dlm timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ); CREATE TABLE apps ( Id int not null unique, -- AppId Sym varchar(8) not null default '', -- app symbol name Nam varchar(30) not null default '', -- app full name BitPriv varchar(10) not null default '', -- app bit priv NamPriv varchar(255) not null default '', -- app nam priv AppDir varchar(80) not null default '', -- app dir nam AppPag varchar(32) not null default '', -- app page nam Aka int, -- ptr to real name Uid int not null default 0, -- ptr to las mod user id Dlm timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ); query on pqsql postgresql7-7.0.2.k62-8 redhat 7.2 select * from apps where (not (apppag = null or apppage = '')); returns data not sure if current table actualy has not null default '' on apppag field but I know that was the reason for the query being as it was query on pgsql postgresql 7.3.2-3 redhat 9.0 with new table definition select * from apps where (not (apppag = null or apppag = '')) returns nothing 0 rows select * from apps where (not apppag = null); returns nothing when it should return every thing select * from apps where (not apppag = ''); returns data as expected Lessons learned as programer always check database definitions only check for what is possible. (not my style I like to write paranoid code) (never trust the dba) lessens learned as a dba always prevent as much illeagle, unwanted data as possible. (I try when ever I get the enough time to spend on being a dba) and finialy the programer and the dba should talk often to optimize code espesialy when there the same person. Arno