Re: Most efficient way for libPQ .. PGresult serialization

From: Craig Ringer <craig(at)2ndquadrant(dot)com>
To: Joshua Bay <joshuabay93(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Most efficient way for libPQ .. PGresult serialization
Date: 2016-08-18 05:02:38
Message-ID: CAMsr+YECX0dBH1-f_VRvuRMxNght6H5JR+8FKNGirS5qQx0xWg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 18 August 2016 at 10:05, Joshua Bay <joshuabay93(at)gmail(dot)com> wrote:

> Hi,
>
> I was trying to implement a middleware that lies between client and
> postgres.
>
> So, this middleware is supposed to run query with libpq, do its job on
> them, and then serialize the result of query, and send it to the client !
> (client deserializes to PGresult)
>
> I could simply iterate over rows and columns but than that would be slow.
> I also found that query results consist of 3 parts (PGresult, tuples, data
> blocks).
>
> Could I please get some pointers ? :)
>
>
Take a look at the code for PgBouncer and PgPool-II. Both implement
PostgreSQL protocol proxies you could use as starting points.

--
Craig Ringer http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2016-08-18 05:06:21 Re: Anyone want to update our Windows timezone map?
Previous Message Craig Ringer 2016-08-18 05:00:49 Re: How to do failover in pglogical replication?