Timestamp and interval precision

From: "Vilson farias" <vilson(dot)farias(at)digitro(dot)com(dot)br>
To: <pgsql-general(at)postgresql(dot)org>
Cc: "SIMONE Carla MOSENA" <simone(dot)mosena(at)digitro(dot)com(dot)br>
Subject: Timestamp and interval precision
Date: 2003-10-24 13:28:15
Message-ID: 011201c39a32$d7f1b490$98a0a8c0@dgtac
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Greetings,

I was doing some tests with timestamps and intervals and I've discovered,
for my surprise, that I can't set precision for resulting fields of type
interval when I'm executing a query. Please follow my tests :

bxs=# select CAST('10:32:14.553243' AS interval);
interval
-----------------
10:32:14.553243
(1 row)

bxs=# select CAST('10:32:14.553243' AS interval(0));
interval
-----------------
10:32:14.553243
(1 row)

But I can set precision when it's a timestamp :

bxs=# SELECT CAST('2003-10-09 23:45:34.543543' AS timestamp);
timestamp
----------------------------
2003-10-09 23:45:34.543543
(1 row)

bxs=# SELECT CAST('2003-10-09 23:45:34.543543' AS timestamp(0));
timestamp
---------------------
2003-10-09 23:45:35
(1 row)

Is it a known limitation?

Best regards,

----------------------------------------------------------------------------
----
José Vilson de Mello de Farias
Software Engineer

Dígitro Tecnologia Ltda - www.digitro.com.br
APC - Customer Oriented Applications
E-mail: vilson(dot)farias(at)digitro(dot)com(dot)br
Tel.: +55 48 281 7158
ICQ 11866179

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Manfred Koizar 2003-10-24 13:34:25 Re: Nullable 'Foreign Key-like' Constraint
Previous Message Bob Messenger 2003-10-24 13:16:41 Re: Simple SQL