empty text fields

From: "Leif B(dot) Kristensen" <leif(at)solumslekt(dot)org>
To: pgsql-general(at)postgresql(dot)org
Subject: empty text fields
Date: 2006-06-28 15:14:42
Message-ID: 200606281714.42206.leif@solumslekt.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On a tangent to the never-ending NULL debate, I've got a table:

CREATE TABLE events (
event_id INTEGER PRIMARY KEY,
tag_fk INTEGER REFERENCES tags (tag_id),
place_fk INTEGER REFERENCES places (place_id),
event_date CHAR(18) NOT NULL DEFAULT '000000003000000001',
sort_date DATE NOT NULL DEFAULT '40041024BC',
event_note TEXT NOT NULL DEFAULT ''
);

The event_note will contain text in roughly 1 out of 5 rows:

pgslekt=> select count(*) from events;
count
-------
29473
(1 row)

pgslekt=> select count(*) from events where event_note <> '';
count
-------
5572
(1 row)

I wonder if this is sane design, in theory and in practice, or should I
break out the event_note field in a separate table?
--
Leif Biberg Kristensen | Registered Linux User #338009
http://solumslekt.org/ | Cruising with Gentoo/KDE

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David Fetter 2006-06-28 15:37:48 Re: empty text fields
Previous Message David Fetter 2006-06-28 15:08:17 Re: Null and Void() - Or, Abandon All Hope Ye Who allow NULLs?