From: | Sebastien FLAESCH <sf(at)4js(dot)com> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: Normalize INTERVAL ouput format in a db driver |
Date: | 2009-07-06 12:25:40 |
Message-ID: | 4A51ED44.9030607@4js.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Further, little libpq question:
When using INTERVAL types, can I rely on PQfmod(), PQfsize() to determine
the exact definition of the INTERVAL precision?
=> what YEAR/MONTH/DAY/HOUR/MINUTE/SECOND fields where used to create the column.
I get different values for the type modifier, but how to interpret this?
Can someone point me to the documentation or source code where I can find
more details about this?
I found this:
http://www.postgresql.org/docs/8.4/static/libpq-exec.html#LIBPQ-EXEC-SELECT-INFO
But there are not much details in PQfmod() description...
Thanks!
Seb
Sebastien FLAESCH wrote:
> Hi all,
>
> Just testing 8.4rc2 INTERVALs...
>
> According to the doc, INTERVAL output format is controlled by SET
> intervalstyle.
>
> I am writing an interface/driver and need a solution to fetch/convert
> interval
> values independently from the current format settings...
>
> I could force my driver to implicitly set the intervalstyle to iso_8601,
> but I
> would prefer to leave this in the hands of the programmer...
>
> Imagine you have to write and ODBC interface/driver with libpq that must
> support
> the SQLINTERVAL C structure, how would you deal with PostgreSQL intervals?
>
> Is it possible to query the current intervalstyle?
>
> Thanks!
> Seb
>
>
>
From | Date | Subject | |
---|---|---|---|
Next Message | Greg Stark | 2009-07-06 12:54:12 | Re: COALESCE not filtering well. |
Previous Message | Abbas | 2009-07-06 12:18:40 | Re: Postgres Plus Advanced Server and general Postgres compatibility? |