Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UfIpT-0002GX-Vv for pgsql-interfaces@arkaria.postgresql.org; Wed, 22 May 2013 23:52:24 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1UfIpT-0000mY-B9 for pgsql-interfaces@arkaria.postgresql.org; Wed, 22 May 2013 23:52:23 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UfIpR-0000mQ-5j for pgsql-interfaces@postgresql.org; Wed, 22 May 2013 23:52:21 +0000 Received: from nm5-vm0.bullet.mail.bf1.yahoo.com ([98.139.213.150]) by makus.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1UfIpK-0008Kp-QV for pgsql-interfaces@postgresql.org; Wed, 22 May 2013 23:52:20 +0000 Received: from [98.139.212.150] by nm5.bullet.mail.bf1.yahoo.com with NNFMP; 22 May 2013 23:52:13 -0000 Received: from [98.139.212.249] by tm7.bullet.mail.bf1.yahoo.com with NNFMP; 22 May 2013 23:52:13 -0000 Received: from [127.0.0.1] by omp1058.mail.bf1.yahoo.com with NNFMP; 22 May 2013 23:52:13 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 973138.17386.bm@omp1058.mail.bf1.yahoo.com Received: (qmail 9556 invoked by uid 60001); 22 May 2013 23:52:13 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1369266733; bh=2UNiQUvZP+QljF3oG4kv9aAbjRpSDzH5dGEwQchWGms=; h=X-YMail-OSG:Received:X-Rocket-MIMEInfo:X-Mailer:References:Message-ID:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=Bzq7kFyI146Kk4NPA+4t23tnQG/Rids1luI1xJLDEd0eMll6P6BoUk+dqcJthoKG/4bMb/2beEckLPqO+tXFS/mYd8HZL7DAeLWcoxAkSqU+QQSiJv9bYmHCCaN44VjosTwdcP6cnBMfFpbbcf856bTmhJJR6lbzeMxqEnOXypI= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:X-Rocket-MIMEInfo:X-Mailer:References:Message-ID:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=ogE4PNm0NmlLqJx2BbPlH/6UiMM/P/8EiWiEUbyrmdMtR/TmQq0cTal/lbKIw9fag3Pzo2eE7/x14UPNUoKOEuTuzq35CYz2LofPdYOYT34UZqi1LAu8QmnXzwaqtf/VJTfzuSs2D2d8YJe+4cxboaMqDPkif9yK1r4KxdfpLkI=; X-YMail-OSG: ax6QBxIVM1k6bZovil8WpITilqrjJ.BHyCHEdtTL9_8KxiX vgc4g0479pfPgfjthEX7C6ur7yGWB3KChVaNr_tv6ubnQm_abktBM21pXv9K q3yoDJwRNiH6mc6N_OqenASUoxIzu7vdmnwQnPx7ciFjnf8m.pbFj6FclgT4 gvg_WluXEjcSJFLc439mAEYRdlidMQGYWS04ezoDYUFiyPhBtfVU4kAkJjYz td4bnRJx2ng6KX00kGeol9QB5pem.1y4N1iur1tsWdXI9AaMKnLrYKeIS4W7 ezRVAn2fbCdElQ8VnjXgtC45ajf5VAM0I9cglU1vXC3GVbj0djwc3dMtbuJo jTp7YLQouJd9u3tEmmdiDLNWgMdYtSTWKEe9T48J9TnTjbhSXkoJkARSbD8k K3nTZcMBg7nkDigWTDrg35BbeOk31Q_DjYdP1RvBLBq19Fi65_tDENEbWw6o NLC.CRqzA8HphNUAsUXntCFzepStw6nasTK4B_dTGotcMwxbcbmQLozfn1tH zrQJh_8SfEpdk36.Q7oh8S1hG Received: from [69.125.89.202] by web164902.mail.bf1.yahoo.com via HTTP; Wed, 22 May 2013 16:52:13 PDT X-Rocket-MIMEInfo: 002.001, SGksCgoxLiBJIGFtIGhhdmluZyB0cm91YmxlIHdyaXRpbmcgbG9uZyB2YWx1ZXMgdmlhIGMgaW50ZXJmYWNlIC50ZXN0bGlicXAtZHQuYyDCoGlzIGF0dGFjaGVkLgouIDIgaXMgYmVpbmcgaW5zZXJ0ZWQgYXMgODU4OTkzNDU5Mi4KCgpxc2Y9PiBzZWxlY3QgKiBmcm9tIHQxOwrCoCDCoGN1cmRhdGUgwqAgfCDCoHN0cmYgwqB8IMKgIMKgIMKgIMKgaW50ZiDCoCDCoCDCoCDCoHwgwqAgwqAgwqAgwqAgdG1fbmV3IMKgIMKgIMKgIMKgIHwgdHhuaWTCoAotLS0tLS0tLS0tLS0rLS0tLS0tLS0rLS0tLS0tLS0tLS0BMAEBAQE- X-Mailer: YahooMailWebService/0.8.142.542 References: <1369185968.87888.YahooMailNeo@web164906.mail.bf1.yahoo.com> <1369241530.69063.YahooMailAndroidMobile@web164901.mail.bf1.yahoo.com> Message-ID: <1369266733.72536.YahooMailNeo@web164902.mail.bf1.yahoo.com> Date: Wed, 22 May 2013 16:52:13 -0700 (PDT) From: Neeraj Rai Reply-To: Neeraj Rai Subject: - pgaql long value corrupted using htons To: "pgsql-interfaces@postgresql.org" In-Reply-To: <1369241530.69063.YahooMailAndroidMobile@web164901.mail.bf1.yahoo.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="1144159796-1979214466-1369266733=:72536" X-Pg-Spam-Score: -0.4 (/) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-interfaces Precedence: bulk Sender: pgsql-interfaces-owner@postgresql.org --1144159796-1979214466-1369266733=:72536 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Hi,=0A=0A1. I am having trouble writing long values via c interface .testli= bqp-dt.c =A0is attached.=0A. 2 is being inserted as 8589934592.=0A=0A=0Aqsf= =3D> select * from t1;=0A=A0 =A0curdate =A0 | =A0strf =A0| =A0 =A0 =A0 =A0i= ntf =A0 =A0 =A0 =A0| =A0 =A0 =A0 =A0 tm_new =A0 =A0 =A0 =A0 | txnid=A0=0A--= ----------+--------+--------------------+------------------------+-------= =0A1999-01-10 | hello2 |8589934592 | 1999-01-08 04:05:06-05 | =A0 =A0 3=0A= =0AI tried htobe64 but that didn't help either.=0AAny advise would be appre= ciated.=0A=0A=0A2.=A0I have switched to using string for data and timestamp= and it seems to work.=0A=0AI found functions like TimestampTzGetDatum,time= _t_to_timestamptz in the code=A0=0ABut it seems they are not exposed to int= erface.=0AI have the date time in unix format (via time and gettimeofday). = I would prefer to pass those values=0Ain binary, rather than string format.= Is there any option to do this ? Or is it easily addable?=0A=0Athanks=0ANe= eraj=0A --1144159796-1979214466-1369266733=:72536 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable
Hi,

1. I am havi= ng trouble writing long values via c interface .testlibqp-dt.c  is att= ached.
. 2 is being in= serted as 8589934592.

<= /div>

qsf=3D> select * from t1;
   curdate   |  strf=  |        intf        |  = ;       tm_new         | txnid 
------------+--------+--------------------+------------------------+= -------
1999-01-10 | hello2 |8589934592 | 1999-01-08 04:05:06-05 = |     3
I tried htobe64 but that didn't help either.
A= ny advise would be appreciated.

2. I hav= e switched to using string for data and timestamp and it seems to work.

I found functio= ns like TimestampTzGetDatum,time_t_to_timestamptz in the code 
But it seems they are not exposed = to interface.
I have the date ti= me in unix format (via time and gettimeofday). I would prefer to pass those= values
in binary, rather t= han string format. Is there any option to do this ? Or is it easily addable= ?

thanks
Neeraj

--1144159796-1979214466-1369266733=:72536--