Re: [GENERAL] what is the date format in binary query results

2007-12-14 Thread Andrew Chernow
Merlin Moncure wrote: On Dec 12, 2007 2:14 AM, Samantha Atkins <[EMAIL PROTECTED]> wrote: This brings up a second question. How should I do byte order conversion for 8 byte ints? I can't use hton ntoh routines as they max out at 32 bits. Is there a better way? Also, are floating point number

Re: [GENERAL] what is the date format in binary query results

2007-12-12 Thread Gerald Timothy Quimpo
On Wed, 2007-12-12 at 10:16 -0800, Samantha Atkins wrote: > OK, I read it again. I don't see anything about how the timezone is > specified for this type of column. I went to the manual instead, see below for a useful section. Since the "internally stored value is always in UTC", it doesn't ne

Re: [GENERAL] what is the date format in binary query results

2007-12-12 Thread Andrew Chernow
Merlin Moncure wrote: On Dec 12, 2007 2:14 AM, Samantha Atkins <[EMAIL PROTECTED]> wrote: This brings up a second question. How should I do byte order conversion for 8 byte ints? I can't use hton ntoh routines as they max out at 32 bits. Is there a better way? Also, are floating point number

Re: [GENERAL] what is the date format in binary query results

2007-12-12 Thread Merlin Moncure
On Dec 12, 2007 2:14 AM, Samantha Atkins <[EMAIL PROTECTED]> wrote: > This brings up a second question. How should I do byte order > conversion for 8 byte ints? I can't use hton ntoh routines as they > max out at 32 bits. Is there a better way? Also, are floating point > numbers guaranteed unif

Re: [GENERAL] what is the date format in binary query results

2007-12-12 Thread Daniel Verite
Samantha Atkins wrote: > OK, I read it again. I don't see anything about how the timezone is > specified for this type of column. What differs between timestamp and timestamptz is the behavior on input and output, but in both cases what is effectively stored is only an UTC timestamp, n

Re: [GENERAL] what is the date format in binary query results

2007-12-12 Thread Alvaro Herrera
Samantha Atkins wrote: > OK, I read it again. I don't see anything about how the timezone is > specified for this type of column. It is not -- that's the point. -- Alvaro Herrera http://www.amazon.com/gp/registry/CTMLCN8V17R4 "La tristeza es un muro entre dos jardines" (Khalil

Re: [GENERAL] what is the date format in binary query results

2007-12-12 Thread Samantha Atkins
OK, I read it again. I don't see anything about how the timezone is specified for this type of column. On Dec 12, 2007, at 12:06 AM, Tom Lane wrote: Samantha Atkins <[EMAIL PROTECTED]> writes: How can it be a simple 8 byte int or float and specify a timezone? It doesn't. Read the thread

Re: [GENERAL] what is the date format in binary query results

2007-12-12 Thread Samantha Atkins
Less than useful. I did read the thread last night. What am I missing? On Dec 12, 2007, at 12:06 AM, Tom Lane wrote: Samantha Atkins <[EMAIL PROTECTED]> writes: How can it be a simple 8 byte int or float and specify a timezone? It doesn't. Read the thread again. r

Re: [GENERAL] what is the date format in binary query results

2007-12-12 Thread Tom Lane
Samantha Atkins <[EMAIL PROTECTED]> writes: > How can it be a simple 8 byte int or float and specify a timezone? It doesn't. Read the thread again. regards, tom lane ---(end of broadcast)--- TIP 6: explain analyze is yo

Re: [GENERAL] what is the date format in binary query results

2007-12-12 Thread Tom Lane
Samantha Atkins <[EMAIL PROTECTED]> writes: > This brings up a second question. How should I do byte order > conversion for 8 byte ints? I can't use hton ntoh routines as they > max out at 32 bits. Is there a better way? Well, there's the PDP-endianness of odious memory, but AFAIK all curre

Re: [GENERAL] what is the date format in binary query results

2007-12-11 Thread Samantha Atkins
How can it be a simple 8 byte int or float and specify a timezone? This is only a time interval from a fixed date/time. Where is the timezone part? On Nov 8, 2007, at 7:18 AM, Tom Lane wrote: Samantha Atkins <[EMAIL PROTECTED]> writes: What can I expect for a date format from a PGresult

Re: [GENERAL] what is the date format in binary query results

2007-12-11 Thread Samantha Atkins
This brings up a second question. How should I do byte order conversion for 8 byte ints? I can't use hton ntoh routines as they max out at 32 bits. Is there a better way? Also, are floating point numbers guaranteed uniform? If any one knows a a clean code example of binary binding of

Re: [GENERAL] what is the date format in binary query results

2007-11-08 Thread Alvaro Herrera
Reg Me Please wrote: > Il Thursday 08 November 2007 16:18:58 Tom Lane ha scritto: > > It's either an int8 representing microseconds away from 2000-01-01 > > 00:00:00 UTC, or a float8 representing seconds away from the same > > origin. > > Does this mean that negative numbers are for timestamps bef

Re: [GENERAL] what is the date format in binary query results

2007-11-08 Thread Tom Lane
Reg Me Please <[EMAIL PROTECTED]> writes: > Il Thursday 08 November 2007 17:09:22 Tom Lane ha scritto: >> configure --enable-integer-datetimes. > How can I tell which one has been choosen by my distribution (Ubuntu)? "show integer_datetimes". For programmatic purposes, try PQparameterStatus(pgco

Re: [GENERAL] what is the date format in binary query results

2007-11-08 Thread Tom Lane
Reg Me Please <[EMAIL PROTECTED]> writes: > Il Thursday 08 November 2007 16:18:58 Tom Lane ha scritto: >> It's either an int8 representing microseconds away from 2000-01-01 >> 00:00:00 UTC, or a float8 representing seconds away from the same >> origin. > Does this mean that negative numbers are fo

Re: [GENERAL] what is the date format in binary query results

2007-11-08 Thread Reg Me Please
Il Thursday 08 November 2007 17:09:22 Tom Lane ha scritto: > Reg Me Please <[EMAIL PROTECTED]> writes: > > Il Thursday 08 November 2007 16:18:58 Tom Lane ha scritto: > >> It's either an int8 representing microseconds away from 2000-01-01 > >> 00:00:00 UTC, or a float8 representing seconds away from

Re: [GENERAL] what is the date format in binary query results

2007-11-08 Thread Reg Me Please
Il Thursday 08 November 2007 16:18:58 Tom Lane ha scritto: > It's either an int8 representing microseconds away from 2000-01-01 > 00:00:00 UTC, or a float8 representing seconds away from the same > origin. Does this mean that negative numbers are for timestamps before y2k? Why and when there is a

Re: [GENERAL] what is the date format in binary query results

2007-11-08 Thread Tom Lane
Samantha Atkins <[EMAIL PROTECTED]> writes: > What can I expect for a date format from a PGresult containing binary > results? Specifically the Oid type is TIMESTAMPTZOID. It's either an int8 representing microseconds away from 2000-01-01 00:00:00 UTC, or a float8 representing seconds away from

[GENERAL] what is the date format in binary query results

2007-11-07 Thread Samantha Atkins
What can I expect for a date format from a PGresult containing binary results? Specifically the Oid type is TIMESTAMPTZOID. In this case what does the PQgetvalue actually return? What does the char* point to? Thanks. - samantha