Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id D26E5632F45 for ; Tue, 22 Jun 2010 23:43:31 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 12239-01 for ; Wed, 23 Jun 2010 02:43:23 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-px0-f174.google.com (mail-px0-f174.google.com [209.85.212.174]) by mail.postgresql.org (Postfix) with ESMTP id B6EB0632C0A for ; Tue, 22 Jun 2010 23:43:24 -0300 (ADT) Received: by pxi7 with SMTP id 7so91063pxi.19 for ; Tue, 22 Jun 2010 19:43:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:content-type :content-transfer-encoding; bh=OVcdSc3innomlJCXm77hHxsJUYfg6I5sfMEgw70eHh8=; b=TQNLgBNbVYev9LNUWrvwQ55BX6mly5pzpoDTF+qMORIkPhPjBy5VSolMfOyWn6Blqd iRrPV52iSrQzbi/Pc4qSoiOYu/PcJABDWCo1ZEXoEIKQvT/XFx8WjUM+nYETRJSRFxVK +SL43ZMIsLNkRRHPxUHjgBgn4NavIxQFStFw4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; b=xruDJCyDDGu+rCU1MOoW/VwaulQDZxPIcWu/dYx9enR/99Bf44irlus3YqJWL3F0nD yy22YX0TS0ART/1fTUTrxZvnJqGBi+R0iapjVqiv9daB6M671WKZH1/q3/dnz/S5B3hW AkrUweQDQd++mVqq3CLjKpBVx/FLSDqWzcm8A= Received: by 10.115.67.11 with SMTP id u11mr6723293wak.196.1277261002532; Tue, 22 Jun 2010 19:43:22 -0700 (PDT) Received: from [10.0.2.101] (p0245ed.tokyff01.ap.so-net.ne.jp [121.2.69.237]) by mx.google.com with ESMTPS id c1sm65321832wam.19.2010.06.22.19.43.20 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 22 Jun 2010 19:43:21 -0700 (PDT) Message-ID: <4C2174CD.7010304@gmail.com> Date: Wed, 23 Jun 2010 11:43:25 +0900 From: Satoshi Nagayasu User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; ja; rv:1.9.1.10) Gecko/20100512 Thunderbird/3.0.5 MIME-Version: 1.0 To: pgsql-interfaces@postgresql.org Subject: ECPG/SQLDA question - parsing an "interval" binary form Content-Type: text/plain; charset=ISO-2022-JP Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-5 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001 X-Spam-Level: X-Archive-Number: 201006/15 X-Sequence-Number: 6916 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