empty text fields - Mailing list pgsql-general

From Leif B. Kristensen
Subject empty text fields
Date
Msg-id 200606281714.42206.leif@solumslekt.org
Whole thread Raw
Responses Re: empty text fields  (David Fetter <david@fetter.org>)
List 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

pgsql-general by date:

Previous
From: David Fetter
Date:
Subject: Re: Null and Void() - Or, Abandon All Hope Ye Who allow NULLs?
Next
From: David Fetter
Date:
Subject: Re: empty text fields