Thread: "posttime" time DEFAULT now()

"posttime" time DEFAULT now()

From
"Koen Antonissen"
Date:
Hi

"posttime" time DEFAULT now()

I'm declaring a field called posttime (see above), which ofcourse stores
the time of a certain posting. It's nice to use a default value as
now(). But unfourtunatly, while creating the table, it generates the
following error:

ERROR:  Column "posttime" is of type time without time zone but default
expression is of type timestamp with time zone       You will need to rewrite or cast the expression

I prefer to ignore the timezone information... any hints?

NOTE: I've updated from 7.1 to 7.2b2 and before there was no problem
like this (exact same table existed on 7.1).


Thanks,
Koen Antonissen


Re: "posttime" time DEFAULT now()

From
"Christopher Kings-Lynne"
Date:
Try making it: "posttime" time DEFAULT 'CURRENT_TIME';

Chris

> -----Original Message-----
> From: pgsql-sql-owner@postgresql.org
> [mailto:pgsql-sql-owner@postgresql.org]On Behalf Of Koen Antonissen
> Sent: Thursday, 22 November 2001 9:30 PM
> To: pgsql-sql@postgresql.org
> Subject: [SQL] "posttime" time DEFAULT now()
> 
> 
> Hi
> 
> "posttime" time DEFAULT now()
> 
> I'm declaring a field called posttime (see above), which ofcourse stores
> the time of a certain posting. It's nice to use a default value as
> now(). But unfourtunatly, while creating the table, it generates the
> following error:
> 
> ERROR:  Column "posttime" is of type time without time zone but default
> expression is of type timestamp with time zone
>         You will need to rewrite or cast the expression
> 
> I prefer to ignore the timezone information... any hints?
> 
> NOTE: I've updated from 7.1 to 7.2b2 and before there was no problem
> like this (exact same table existed on 7.1).
> 
> 
> Thanks,
> Koen Antonissen
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
> 



Re: "posttime" time DEFAULT now()

From
"Koen Antonissen"
Date:
I had our sysadmin reinstall 7.1 again, we were in a hurry. Thanks for
the hint though!

Koen Antonissen

-----Original Message-----
From: Christopher Kings-Lynne [mailto:chriskl@familyhealth.com.au]
Sent: vrijdag 23 november 2001 2:42
To: Koen Antonissen; pgsql-sql@postgresql.org
Subject: RE: [SQL] "posttime" time DEFAULT now()


Try making it: "posttime" time DEFAULT 'CURRENT_TIME';

Chris

> -----Original Message-----
> From: pgsql-sql-owner@postgresql.org
> [mailto:pgsql-sql-owner@postgresql.org]On Behalf Of Koen Antonissen
> Sent: Thursday, 22 November 2001 9:30 PM
> To: pgsql-sql@postgresql.org
> Subject: [SQL] "posttime" time DEFAULT now()
> 
> 
> Hi
> 
> "posttime" time DEFAULT now()
> 
> I'm declaring a field called posttime (see above), which ofcourse
stores
> the time of a certain posting. It's nice to use a default value as
> now(). But unfourtunatly, while creating the table, it generates the
> following error:
> 
> ERROR:  Column "posttime" is of type time without time zone but
default
> expression is of type timestamp with time zone
>         You will need to rewrite or cast the expression
> 
> I prefer to ignore the timezone information... any hints?
> 
> NOTE: I've updated from 7.1 to 7.2b2 and before there was no problem
> like this (exact same table existed on 7.1).
> 
> 
> Thanks,
> Koen Antonissen
> 
> ---------------------------(end of
broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to
majordomo@postgresql.org
>