Re: one other big mysql->postgresql item

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: George Johnson <gjohnson(at)jdsc(dot)com>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: one other big mysql->postgresql item
Date: 2000-12-11 16:42:25
Message-ID: Pine.LNX.4.30.0012111738240.1147-100000@peter.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

George Johnson writes:

> Forgot one other biggy:
>
> 0000-00-00 00:00:00
>
> is legal for a default value of '' of a datetime column defined as not null.
>
> create table test (
> funkydate datetime not null;
> );
>
> insert into test values ('');
>
> select * from test where funkydate = '0000-00-00 00:00:00';
>
> all those work, in MySQL, and I'm willing to bet a LOT of users have code reflecting that.

Just because MySQL violates century-old time keeping conventions, SQL, and
common sense that doesn't mean it's right. If you want to store
'0000-00-00 00:00:00' in your database then you can use the character
types.

--
Peter Eisentraut peter_e(at)gmx(dot)net http://yi.org/peter-e/

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message George Johnson 2000-12-11 16:45:01 Re: one other big mysql->postgresql item
Previous Message Camm Maguire 2000-12-11 16:14:42 Re: Sequences in transaction