469,366 Members | 2,225 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,366 developers. It's quick & easy.

Timestamp and interval precision

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: vi***********@digitro.com.br
Tel.: +55 48 281 7158
ICQ 11866179
---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

Nov 12 '05 #1
1 2780
"Vilson farias" <vi***********@digitro.com.br> writes:
bxs=# select CAST('10:32:14.553243' AS interval(0));
interval
-----------------
10:32:14.553243
(1 row)


This is a known bug in 7.3 and before --- it's fixed for 7.4.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Craig Bailey | last post: by
reply views Thread by Jeff Boes | last post: by
reply views Thread by Ian E. Morgan | last post: by
6 posts views Thread by Scott Nixon | last post: by
5 posts views Thread by Simen Haugen | last post: by
67 posts views Thread by James Harris | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.