Re: Protocol & Transmitted Field Data

From: Kenneth Marshall <ktm(at)rice(dot)edu>
To: Greg <grigorey(at)yahoo(dot)co(dot)uk>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Protocol & Transmitted Field Data
Date: 2010-07-04 16:07:07
Message-ID: 20100704160707.GA25656@aart.is.rice.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Sun, Jul 04, 2010 at 04:00:25PM +0000, Greg wrote:
> Hi everyone,
>
> I have a question regarding field format used to transmit data (when data is transmitted over the protocol): Is there a way to change field format used by database to transmit data from text to binary?
>
> Whats happening: I have 2 columns in a table, both integers, when they transmitted over to client, their values transmitted as a collection of characters e.g. number 1234567 represented as '1' '2' '3' '4' '5' '6' '7' instead of using 4 bytes for int4
>
> Thanks!
>

You need to use PQexecParams() with binary parameters. You can also request the results
in either binary or text:

http://www.postgresql.org/docs/9.0/static/libpq-exec.html

Cheers,
Ken

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Greg 2010-07-04 19:31:43 Re: Protocol & Transmitted Field Data
Previous Message Greg 2010-07-04 16:00:25 Protocol & Transmitted Field Data