Re: postgresql vs mysql

Поиск
Список
Период
Сортировка
От Tommy Gildseth
Тема Re: postgresql vs mysql
Дата
Msg-id 45DF17AF.1040902@gildseth.com
обсуждение исходный текст
Ответ на Re: postgresql vs mysql  (Ben <bench@silentmedia.com>)
Список pgsql-general
Ben wrote:
> I'm sorry maybe I missed something, but if you don't need NULLs and
> feel they just add extra work, why don't you just declare all your
> columns to be not null and have them default to zero or an empty string?

....which is what mySQL does by default :-)
The statement
CREATE TABLE foo (bar INTEGER NOT NULL, rab VARHCAR(123) NOT NULL, oof
DATETIME NOT NULL,);
will be rewritten automatically by mySQL to
CREATE TABLE foo (bar INTEGER NOT NULL DEFAULT 0, rab VARHCAR(123) NOT
NULL DEFAULT '', oof DATETIME NOT NULL DEFAULT '0000-00-00 00:00');

Maybe if you really want to enforce a NOT NULL constraint in mySQL, you
have to declare a column as NOT NULL DEFAULT NULL, explicitly as was
suggested somewhere else in this thread. Fascinating how they probably
thought that was a good idea.

--
Tommy


В списке pgsql-general по дате отправления:

Предыдущее
От: "Joshua D. Drake"
Дата:
Сообщение: Re: PGSQL Locking vs. Oracle's MVCC
Следующее
От: "Joshua D. Drake"
Дата:
Сообщение: Re: ODBCng and OpenOffice 2.1