libpq -- reading a timestamp with time zone using binary format

From: Whit Armstrong <armstrong(dot)whit(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: libpq -- reading a timestamp with time zone using binary format
Date: 2009-03-23 21:00:43
Message-ID: 8ec76080903231400q2dc5b46fs29a424f074419039@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

how does one determine whether libpq is sending an int64 or a double?

I see all of the #ifdefs in the source:

#ifdef HAVE_INT64_TIMESTAMP
static int64 time2t(const int hour, const int min, const int sec,
const fsec_t fsec);
#else
static double time2t(const int hour, const int min, const int sec,
const fsec_t fsec);
#endif

but it is still unclear (at least to me) how to determine as the
client whether the server has been compiled with the
HAVE_INT64_TIMESTAMP flag.

since both int64 and double use 8 bytes of storage on x86_64, you
can't determine the type using PQfsize.

Any suggestions would be appreciated.

-Whit

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Scott Marlowe 2009-03-23 21:01:20 Re: unexpected check constraint violation
Previous Message Jacek Becla 2009-03-23 20:52:50 Re: unexpected check constraint violation