Re: Most efficient way for libPQ .. PGresult serialization - Mailing list pgsql-hackers

From Tatsuo Ishii
Subject Re: Most efficient way for libPQ .. PGresult serialization
Date
Msg-id 20160818.143317.1337807404635546038.t-ishii@sraoss.co.jp
Whole thread Raw
In response to Re: Most efficient way for libPQ .. PGresult serialization  (Craig Ringer <craig@2ndquadrant.com>)
Responses Re: Most efficient way for libPQ .. PGresult serialization  (Joshua Bay <joshuabay93@gmail.com>)
List pgsql-hackers
> On 18 August 2016 at 10:05, Joshua Bay <joshuabay93@gmail.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.

This one is based on Pgpool-II.

https://github.com/treasure-data/prestogres

Best regards,
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese:http://www.sraoss.co.jp



pgsql-hackers by date:

Previous
From: Venkata B Nagothi
Date:
Subject: Re: patch proposal
Next
From: Michael Paquier
Date:
Subject: Re: patch proposal