Timestamp precission question

From: Vaclav TVRDIK <tvrdik(at)i3(dot)cz>
To:
Cc: pgsql-general(at)postgresql(dot)org
Subject: Timestamp precission question
Date: 2008-11-11 15:36:04
Message-ID: 4919A664.2000405@i3.cz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello all,

I have one question about converting timestamps to text. I believed
that using to_char function with proper mask and casting by style
COLUMN::text is equal, but when I issue following query against 8.3.3
database it returns me different values (they differ on last position
of microsecconds value, maybe rounding error ?).
Could please somebody tell me what is the
reason ? I have tried to find some info about it on web but without
success.

Thanks in advance
Vaclav TVRDIK

WoC=> SELECT to_char(create_dat, 'YYYY-DD-MM HH24:MI:SS:US'),
create_dat::text
WoC-> from config
WoC-> where parameter_name = 'app_server_db_conn_pooler_connections';
to_char | create_dat
----------------------------+----------------------------
2008-02-09 12:12:15:214268 | 2008-09-02 12:12:15.214269
(1 row)

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Sergey Konoplev 2008-11-11 16:07:17 Re: Very slow queries w/ NOT IN preparation (seems like a bug, test case)
Previous Message Richard Huxton 2008-11-11 15:16:25 Re: Very slow queries w/ NOT IN preparation (seems like a bug, test case)