Re: SET DATESTYLE to time_t style for client libraries?

From: Jason Earl <jason(dot)earl(at)simplot(dot)com>
To: Adam Haberlach <adam(at)newsnipple(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: SET DATESTYLE to time_t style for client libraries?
Date: 2002-01-03 22:13:29
Message-ID: 87sn9n3wxi.fsf@npa01zz001.simplot.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


I would suggest taking a look at the mxDateTime package if you want to
manipulate dates in Python.

Adam Haberlach <adam(at)newsnipple(dot)com> writes:

<snip>

>
> I'll look into getting it to ingest dates, but it seems
> wasteful to have the server take its internal reprentation,
> pretty-format it into a nice human-readable representation to send
> to the client, and then have the client parse that into something it
> can deal with internally. While it is a fairly minor performance
> issue, it seems there are a lot of chances for things to go wrong.

That's a good point. On the other hand, I trust the PostgreSQL folks
to know more about all of the wacky time edge cases than I do. I know
that I am not particular excited about using raw time_t values.

> I've already had to hack my python libs a bit to make the
> money type work correctly. It takes the incoming text, removes '$'
> and ',' and then tries to convert it into a float. In the case of
> negative values, it will blow up because there are "()" around the
> value. I'll submit a patch if anyone is interested.

Why not simply use the numeric type? I thought the money type was
deprecated.

> ...I assume that the ISO-8601 representation itself won't be
> changing, but time is silly and there's a lot of edge cases. It'd
> be nice to have a way to reliabily tell the server "Give me
> standardized raw values, I'll sort things out on my end." Of
> course, this may already be happening within the C libraries and I'm
> not seeing them inside python. I'll look around a bit more.

mxDateTime is your friend.

Jason

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2002-01-03 22:33:42 Re: More problem with scripts
Previous Message Bruce Momjian 2002-01-03 21:33:02 postgresql.conf syntax