Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[INTERFACES] ECPG/SQLDA question - parsing an "interval" binary form

0 views
Skip to first unread message

Satoshi Nagayasu

unread,
Jun 22, 2010, 10:43:25 PM6/22/10
to
Hi all,

I have a question on parsing an "interval" binary form.

I'm working on ECPG/SQLDA things, and being stuck in front of
retreiving "interval" values.

Through SQLDA, "interval" values are returned in the 12 bytes binary form,
so I have to parse it to use the interval values in the host program.

-----------------------------------------------
interval form: '10 years 5 hours 10 minutes 1 second'::interval
binary form: 40 bc b4 54 04 00 00 00 78 00 00 00
-----------------------------------------------

However, I don't have an appropriate way to parse and convert it
into host variable structures, like "time_t", "struct tm" or else.

Do you have any good way or good routine to parse the PostgreSQL
"interval" binary form for the host (C language) program?

Regards,

--
NAGAYASU Satoshi <satoshi....@gmail.com>

--
Sent via pgsql-interfaces mailing list (pgsql-in...@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-interfaces

0 new messages