agora inbox for pgsql-interfaces@postgresql.org  
help / color / mirror / Atom feed
From: Satoshi Nagayasu <satoshi.nagayasu@gmail.com>
To: pgsql-interfaces@postgresql.org
Subject: ECPG/SQLDA question - parsing an "interval" binary form
Date: Wed, 23 Jun 2010 11:43:25 +0900
Message-ID: <4C2174CD.7010304@gmail.com> (raw)

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.nagayasu@gmail.com>



Message-ID: <4C2174CD.7010304@gmail.com>
Permalink:  ../4C2174CD.7010304@gmail.com/
Also on:    postgresql.org/message-id/4C2174CD.7010304@gmail.com

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: satoshi.nagayasu@gmail.com
  Subject: Re: ECPG/SQLDA question - parsing an "interval" binary form
  In-Reply-To: <4C2174CD.7010304@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox