From: maillist <maillist@tnss.com>
To: pgsql-admin@postgresql.org <pgsql-admin@postgresql.org>
Subject: fyi
Date: Thu, 31 Jul 2003 23:54:11 -0500
Message-ID: <3F29F273.3A3B8137@tnss.com> (raw)
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
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: maillist@tnss.com
Subject: Re: fyi
In-Reply-To: <3F29F273.3A3B8137@tnss.com>
References: <3F29F273.3A3B8137@tnss.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox