Skip site navigation (1) Skip section navigation (2)

Re: alter column type (from timestamp to date) violates not null

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: psmith <suller(dot)andras(at)gmail(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: alter column type (from timestamp to date) violates not null
Date: 2007-03-10 15:56:05
Message-ID: 20070310155604.GA83166@winnie.fuhr.org (view raw or flat)
Thread:
Lists: pgsql-bugs
On Fri, Mar 09, 2007 at 04:55:59AM -0800, psmith wrote:
> When change a column type from timestamp to date, the 'infinity' and '-
> infinity' values will be NULL. Even if the column has a not null
> constraint.
[...]
>                                                    version
> --------------------------------------------------------------------------------------------------------------
>  PostgreSQL 8.1.0 on i486-pc-linux-gnu, compiled by GCC cc (GCC) 4.0.3
> 20051023 (prerelease) (Debian 4.0.2-3)
> (1 sor)

This appears to be fixed already:

test=> alter table a alter t type date;
ERROR:  column "t" contains null values
test=> select version();
                                  version                                  
---------------------------------------------------------------------------
 PostgreSQL 8.1.8 on sparc-sun-solaris2.9, compiled by GCC gcc (GCC) 3.4.2
(1 row)

-- 
Michael Fuhr

In response to

Responses

pgsql-bugs by date

Next:From: Tom LaneDate: 2007-03-10 17:30:08
Subject: Re: alter column type (from timestamp to date) violates not null
Previous:From: Geoff RussellDate: 2007-03-10 10:17:21
Subject: BUG #3134: Can't edit with odbc

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group