agora inbox for pgsql-interfaces@postgresql.org  
help / color / mirror / Atom feed
From: Neeraj Rai <rneeraj@yahoo.com>
To: pgsql-interfaces@postgresql.org <pgsql-interfaces@postgresql.org>
Subject: - pgaql long value corrupted using htons
Date: Wed, 22 May 2013 16:52:13 -0700 (PDT)
Message-ID: <1369266733.72536.YahooMailNeo@web164902.mail.bf1.yahoo.com> (raw)
In-Reply-To: <1369241530.69063.YahooMailAndroidMobile@web164901.mail.bf1.yahoo.com>
References: <1369185968.87888.YahooMailNeo@web164906.mail.bf1.yahoo.com>
	<1369241530.69063.YahooMailAndroidMobile@web164901.mail.bf1.yahoo.com>
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-interfaces>

Hi,

1. I am having trouble writing long values via c interface .testlibqp-dt.c  is attached.
. 2 is being inserted as 8589934592.


qsf=> 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.
Any advise would be appreciated.


2. I have switched to using string for data and timestamp and it seems to work.

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

thanks
Neeraj


view thread (3+ messages)  latest in thread

Message-ID: <1369266733.72536.YahooMailNeo@web164902.mail.bf1.yahoo.com>
Permalink:  ../1369266733.72536.YahooMailNeo@web164902.mail.bf1.yahoo.com/
Also on:    postgresql.org/message-id/1369266733.72536.YahooMailNeo@web164902.mail.bf1.yahoo.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: rneeraj@yahoo.com
  Subject: Re: - pgaql long value corrupted using htons
  In-Reply-To: <1369266733.72536.YahooMailNeo@web164902.mail.bf1.yahoo.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