Re: How to setup only one connection for the whole event loop?

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: How to setup only one connection for the whole event loop?
Date: 2019-02-15 16:08:10
Message-ID: 6aaf55f2-145e-a395-b372-41cae0037f06@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 2/14/19 8:06 AM, Dominic Gua�a wrote:
> Dear all,
>
> I am new to postgresql and I am creating a c program that can receive
> request from different users. I want to maximize the performance of
> postgresql so I intend to just create 1 connection that would service
> all queries of different users. How do I do this?

Use one of the existing Postgres poolers?:

http://www.pgpool.net/mediawiki/index.php/Main_Page

http://pgbouncer.github.io/

>
> Do I create a new connection each time there is a new request like how
> it goes in MySQL or can I just have one connection that is established
> in my `main` function?
>
> Sincerely

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Rameshbabu Paulsamy (UST, IND) 2019-02-15 16:33:26 RE: PostgreSql Version Compatibility With Apache ActiveMQ
Previous Message Adrian Klaver 2019-02-15 16:06:39 Re: Problems pushing down WHERE-clause to underlying view