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

Re: timestamp precision - can I control precision at select time

From: Christoph Haller <ch(at)rodos(dot)fzk(dot)de>
To: "mroyce(at)gmail(dot)com" <mroyce(at)gmail(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: timestamp precision - can I control precision at select time
Date: 2005-03-22 08:50:05
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-sql
"mroyce(at)gmail(dot)com" wrote:
> I have a database with several tables that use timestamp without time
> zone type. I upgraded from an older pgsql and have code that does not
> expect the precision in the select output. Is there a way I can get the
> effect of zero precision without modifying all the tables?
> The docs say it uses "default precision" as set in the "timestamp
> literal". I wasn't able to find docs describing what literals are. If
> there's a way I can set this to zero precision for everything, that'd
> save me a bunch of time.
> with thanks,
> Royce

I was facing the same obstacle. 
The only cure I've found was either 

 2005-03-22 09:43:51.05193+01
(1 row)

 2005-03-22 09:44:11
(1 row)

resp. change column types to TIMESTAMP(0) 
But I assume you've found this already by yourself. 

Regards, Christoph

In response to


pgsql-sql by date

Next:From: Christoph HallerDate: 2005-03-22 09:38:06
Subject: Re: Your question about date
Previous:From: Theo GalanakisDate: 2005-03-22 05:43:48
Subject: Re: C function extending postgres

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