Re: Receiving data in binary format how is it encoded?

From: "Francisco Figueiredo Jr(dot)" <fxjrlists(at)yahoo(dot)com(dot)br>
To: Carlos Guzman Alvarez <carlosga(at)telefonica(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Receiving data in binary format how is it encoded?
Date: 2003-07-06 20:37:36
Message-ID: 3F088890.1000604@yahoo.com.br
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Carlos Guzman Alvarez wrote:

> Hello:
>

Hello

>> Yeah, while waiting for the response, I added support for the int4
>> datatype. It is really encoded as a 4 bytes value.
>
>
> :)
>
>> Uhmmm, where did you take the 2000,1,1 as base from?
>> If the date is before 2000, days will have a negative value, so date
>> is calculated correctly backwards?
>
>
> In the little tests i do, yes.

Good. I think I found where you get 200,1,1 from:
In datetime.c in the AST dir, there is a line which says:
Assert(POSTGRES_EPOCH_JDATE == date2j(2000, 1, 1));

>
>
>> Thanks Carlos. do you know in what file are these values produced?
>
>
> Not sure but i'm reviewing files in directory:
>
> src\backend\utils\adt
>
> This is what seems to be sent for numeric datatype i'm going to test it
> now :D:
>
> pq_sendint(&buf, x.ndigits, sizeof(int16));
> pq_sendint(&buf, x.weight, sizeof(int16));
> pq_sendint(&buf, x.sign, sizeof(int16));
> pq_sendint(&buf, x.dscale, sizeof(int16));
> for (i = 0; i < x.ndigits; i++)
> pq_sendint(&buf, x.digits[i], sizeof(NumericDigit));
>
>

Thanks. I will have a look in the types in the AST dir.

--
Regards,

Francisco Figueiredo Jr.

------
"My grandfather once told me that there are two
kinds of people: those
who work and those who take the credit. He told me
to try to be in the
first group; there was less competition there."
- Indira Gandhi

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2003-07-06 21:42:27 Re: aliases
Previous Message ivan 2003-07-06 20:15:37 aliases