Re: question on some code.

From: Chris Bowlby <excalibur(at)accesswave(dot)ca>
To: Korry <korry(at)starband(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: question on some code.
Date: 2005-07-19 18:31:11
Message-ID: 6.2.1.2.0.20050719153038.01c113c8@mail.dreadnet.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Ahh, so it's not attempting to turn it into an "acsii" string, just storing
raw binary data... Ok that makes sense now, thanks for the help.

At 02:54 PM 7/19/2005, Korry wrote:

>>If I understand the code right, your trying to pass in to
>>appendBinaryStringInfo an "address" or reference to the n8, n16, or n32
>>variables and cast them so that a char * pointer can access that address
>>space. Through some testing that I've been doing (outputting the values in
>>the appendBinaryStringInfo function), I never seem to see any data, The
>>variable pointer that references the "n8, n16, or n32" value is not holding
>>any data in the appendBinaryStringInfo function.
>
>How are you looking at the data? If you're treating the pointer as if it
>were a null-terminated string, it's likely that the first byte is a null
>character much of the time. Since this is binary data (not character
>data), you'll need to look at the individual bytes. If you're using gdb,
>use 'x' command instead of the 'p' command. If you've thrown a printf()
>into the code, you can't use a "%s" format specifier, you'll have to look
>at the bytes one at a time using something like "%02X".
>
>
> -- Korry

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jim C. Nasby 2005-07-19 18:36:49 Re: Buildfarm issues on specific machines
Previous Message Tom Lane 2005-07-19 18:29:08 Re: Buildfarm issues on specific machines