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

SET DATESTYLE to time_t style for client libraries?

From: Adam Haberlach <adam(at)newsnipple(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: SET DATESTYLE to time_t style for client libraries?
Date: 2002-01-01 22:26:47
Message-ID: 20020101142647.A23517@newsnipple.com (view raw or flat)
Thread:
Lists: pgsql-hackers
	So I discovered today that pgdb follows in the traditional style of
carrying timestamp and most other time fields through to the user as
text strings, so I either need to have all my queries do some gymnastics
to have the server format my time information in a way that is printable
or can be handled by my client code or whatever.

Is there a better way?  I was thinking that if there was a way to set a
datestyle that would just emit the seconds since the Unix epoch, I could
kick them into the python time module's functions for easier formatting,
and it would give all clients a more standardized way to deal with time
by letting them get the 'raw' values and handle them locally.

Is this a good, bad, or old idea?  Should I spend some time trying to
patch my local system for testing?

-- 
Adam Haberlach      | Who buys an eight-processor machine and then watches 30
adam(at)newsnipple(dot)com | movies on it all at the same time?  Beats me.  They told
                    | us they could sell it, so we made it.
                    |        -- George Hoffman, Be Engineer

Responses

pgsql-hackers by date

Next:From: Brent VernerDate: 2002-01-01 23:01:52
Subject: Re: [PATCHES] system catalog relation of a table and a serial sequence
Previous:From: Bruce MomjianDate: 2002-01-01 20:49:31
Subject: Re: Duplicate-key-detection failure case found in btree

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