empty text fields

Поиск
Список
Период
Сортировка
От Leif B. Kristensen
Тема empty text fields
Дата
Msg-id 200606281714.42206.leif@solumslekt.org
обсуждение исходный текст
Ответы Re: empty text fields
Список 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 по дате отправления:

Предыдущее
От: David Fetter
Дата:
Сообщение: Re: Null and Void() - Or, Abandon All Hope Ye Who allow NULLs?
Следующее
От: David Fetter
Дата:
Сообщение: Re: empty text fields