Обсуждение: problem with date cast

Поиск
Список
Период
Сортировка

problem with date cast

От
andrea gelmini
Дата:
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.