Re: Built-in connection pooler - Mailing list pgsql-hackers

From Jaime Casanova
Subject Re: Built-in connection pooler
Date
Msg-id CAJGNTePSpVRMApCq50-veJGtPcMBPDLio1NkwkNE3wnDsX0KwQ@mail.gmail.com
Whole thread Raw
In response to Re: Built-in connection pooler  (Konstantin Knizhnik <k.knizhnik@postgrespro.ru>)
Responses Re: Built-in connection pooler
Change a constraint's index - ALTER TABLE ... ALTER CONSTRAINT ... USING INDEX ...
List pgsql-hackers
On Wed, 7 Aug 2019 at 02:49, Konstantin Knizhnik
<k.knizhnik@postgrespro.ru> wrote:
>
> Hi, Li
>
> Thank you very much for reporting the problem.
>
> On 07.08.2019 7:21, Li Japin wrote:
> > I inspect the code, and find the following code in DefineRelation function:
> >
> > if (stmt->relation->relpersistence != RELPERSISTENCE_TEMP
> >           && stmt->oncommit != ONCOMMIT_DROP)
> >           MyProc->is_tainted = true;
> >
> > For temporary table, MyProc->is_tainted might be true, I changed it as
> > following:
> >
> > if (stmt->relation->relpersistence == RELPERSISTENCE_TEMP
> >           || stmt->oncommit == ONCOMMIT_DROP)
> >           MyProc->is_tainted = true;
> >
> > For temporary table, it works. I not sure the changes is right.
> Sorry, it is really a bug.
> My intention was to mark backend as tainted if it is creating temporary
> table without ON COMMIT DROP clause (in the last case temporary table
> will be local to transaction and so cause no problems with pooler).
> Th right condition is:
>
>      if (stmt->relation->relpersistence == RELPERSISTENCE_TEMP
>          && stmt->oncommit != ONCOMMIT_DROP)
>          MyProc->is_tainted = true;
>
>

You should also allow cursors without the WITH HOLD option or there is
something i'm missing?

a few questions about tainted backends:
- why the use of check_primary_key() and check_foreign_key() in
contrib/spi/refint.c make the backend tainted?
- the comment in src/backend/commands/sequence.c needs some fixes, it
seems just quickly typed

some usability problem:
- i compiled this on a debian machine with "--enable-debug
--enable-cassert --with-pgport=54313", so nothing fancy
- then make, make install, and initdb: so far so good

configuration:
listen_addresses = '*'
connection_proxies = 20

and i got this:

"""
jcasanov@DangerBox:/opt/var/pgdg/14dev$ /opt/var/pgdg/14dev/bin/psql
-h 127.0.0.1 -p 6543 postgres
psql: error: could not connect to server: no se pudo conectar con el
servidor: No existe el fichero o el directorio
¿Está el servidor en ejecución localmente y aceptando
conexiones en el socket de dominio Unix «/var/run/postgresql/.s.PGSQL.54313»?
"""

but connect at the postgres port works well
"""
jcasanov@DangerBox:/opt/var/pgdg/14dev$ /opt/var/pgdg/14dev/bin/psql
-h 127.0.0.1 -p 54313 postgres
psql (14devel)
Type "help" for help.

postgres=# \q
jcasanov@DangerBox:/opt/var/pgdg/14dev$ /opt/var/pgdg/14dev/bin/psql
-p 54313 postgres
psql (14devel)
Type "help" for help.

postgres=#
"""

PS: unix_socket_directories is setted at /tmp and because i'm not
doing this with postgres user i can use /var/run/postgresql

--
Jaime Casanova                      www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



pgsql-hackers by date:

Previous
From: vignesh C
Date:
Subject: Re: Include access method in listTables output
Next
From: Mitar
Date:
Subject: Re: Persist MVCC forever - retain history