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

problem with date cast

From: andrea gelmini <andrea(dot)gelmini(at)linux(dot)it>
To: pgsql-bugs(at)postgresql(dot)org, tgl(at)sss(dot)pgh(dot)pa(dot)us
Subject: problem with date cast
Date: 2002-05-27 16:21:28
Message-ID: 20020527162128.GA30815@linux.it (view raw or flat)
Thread:
Lists: pgsql-bugs
hi all,
	with latest cvs version of pg i've found this problem:

ns:/tmp> createdb gino
CREATE DATABASE
ns:/tmp> psql gino
Welcome to psql, the PostgreSQL interactive terminal.

Type:  \copyright for distribution terms
       \h for help with SQL commands
       \? for help on internal slash commands
       \g or terminate with semicolon to execute query
       \q to quit

gino=# create table test (date date, timestamp timestamp);
CREATE TABLE
gino=# insert into test values ('now','now');
INSERT 32101 1
gino=# \x                  
Expanded display is on.
gino=# select *,date::date as right,timestamp::date as wrong from test ;
-[ RECORD 1 ]-------------------------
date      | 27/05/2002
timestamp | 27/05/2002 18:17:30,577187
right     | 27/05/2002
wrong     | 01/01/2000

am i missing something?

some info:
Linux ns 2.4.18-pre9-ac4 #1 lun feb 18 14:24:51 CET 2002 i686 unknown
debian (sid)
 PostgreSQL 7.3devel on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 3.1
 (Debian)

all regression tests passed.

thanks a lot for your work,
andrea gelmini

-- 
Jesus died for your sins. Make it worth his time.

pgsql-bugs by date

Next:From: Tom LaneDate: 2002-05-27 16:59:25
Subject: Re: Documentation regarding %ROWTYPE in PL/PgSQL
Previous:From: Mathieu ArnoldDate: 2002-05-27 12:36:08
Subject: Re: pg_dump && aggregate bug

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