Issues with using plpgsql debugger using PG13 on Centos 7

2021-02-01 Thread Jain, Ankit
Hi,

I am trying to setup the debugger plugin on Centos 7 where PG 13 server has 
been setup using the git repository located here - 
https://git.postgresql.org/gitweb/?p=pldebugger.git;a=summary
The OS version is CentOS Linux release 7.9.2009 (Core).

However, after making the changes to postgresql.conf to reference the 
plugin_debugger.so library that was created on CentOS 7 using several 
variations to ensure that the .so file was being referenced -
shared_preload_libraries = '/usr/lib64/pgsql/plugin_debugger'
or
shared_preload_libraries = 'plugin_debugger'
or
shared_preload_libraries = '/usr/pgsql-13/lib/plugin_debugger.so'

I encountered the following error during postgres start up-
-- Unit postgresql-13.service has begun starting up.
Feb 01 21:53:20 myserver.com postmaster[22726]: 2021-02-02 02:53:20.482 GMT 
[22726] LOG:  skipping missing configuration file 
"/data/pgdata/data/postgresql.auto.conf"
Feb 01 21:53:20 myserver.com postmaster[22726]: 2021-02-01 21:53:20.485 EST 
[22726] FATAL:  could not load library "/usr/lib64/pgsql/plugin_debugger.so": 
/usr/lib64/pgsql/plug
Feb 01 21:53:20 myserver.com postmaster[22726]: 2021-02-01 21:53:20.486 EST 
[22726] LOG:  database system is shut down
Feb 01 21:53:20 myserver.com systemd[1]: postgresql-13.service: main process 
exited, code=exited, status=1/FAILURE
Feb 01 21:53:20 myserver.com systemd[1]: Failed to start PostgreSQL 13 database 
server.
-- Subject: Unit postgresql-13.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit postgresql-13.service has failed.
--
-- The result is failed.
Feb 01 21:53:20 rich-arch-01-pp.ipa.snapbs.com systemd[1]: Unit 
postgresql-13.service entered failed state.
Feb 01 21:53:20 rich-arch-01-pp.ipa.snapbs.com systemd[1]: 
postgresql-13.service failed.


Though the library wasn't loaded, I attempted to add the extension at the DB 
level using
CREATE EXTENSION pldbgapi;

But got the following error -
ERROR: could not load library "/usr/pgsql-13/lib/plugin_debugger.so": 
/usr/pgsql-13/lib/plugin_debugger.so: undefined symbol: LWLockAssign SQL state: 
58P01

Can you please help with getting the debugger working ?

Thanks
Ankit


RE: cant connect to localhost:5432 (but unix socket ok)

2021-02-05 Thread Jain, Ankit
Did you try modifying the firewall settings ?

Add postgres service to the firewall. If that doesn’t work, explicitly open the 
port 5433 in the firewall.

From: Joao Miguel Ferreira 
Sent: Thursday, February 4, 2021 10:08 AM
To: Tom Lane 
Cc: dep...@depesz.com; pgsql-general 
Subject: Re: cant connect to localhost:5432 (but unix socket ok)


CAUTION: This email originated from outside of Snap-on. Do not click on links 
or open attachments unless you have validated the sender, even if it is a known 
contact. Contact the sender by phone to validate the contents.


On Thu, Feb 4, 2021 at 3:04 PM Joao Miguel Ferreira 
mailto:joao.miguel.c.ferre...@gmail.com>> 
wrote:


On Thu, Feb 4, 2021 at 3:02 PM Joao Miguel Ferreira 
mailto:joao.miguel.c.ferre...@gmail.com>> 
wrote:
Hi Tom

On Thu, Feb 4, 2021 at 2:50 PM Tom Lane 
mailto:t...@sss.pgh.pa.us>> wrote:
Joao Miguel Ferreira 
mailto:joao.miguel.c.ferre...@gmail.com>> 
writes:
> On Thu, Feb 4, 2021 at 2:26 PM hubert depesz lubaczewski 
> mailto:dep...@depesz.com>>
> wrote:
>>> My database is not listening on TCP/localhost, desptite it is listening
 on the unix socket. How can I investigate this?

> it's on 5433:

Hmm, something odd there, because a port number mismatch should have
resulted in psql failing to connect via unix socket either.  Maybe
you have more than one active postmaster?

"ps xauwww | grep postgres" shows only one postgres process (and a few vaccum 
related)

here is the full list:

root@deb10tp:~# ps xauww | grep postgres
postgres   825  0.0  0.1 213472 14980 ?S09:59   0:01 
/usr/lib/postgresql/11/bin/postgres -D /var/lib/postgresql/11/main -c 
config_file=/etc/postgresql/11/main/postgresql.conf
postgres   847  0.0  0.0 213572  5660 ?Ss   09:59   0:00 postgres: 
11/main: checkpointer
postgres   848  0.0  0.0 213472  3808 ?Ss   09:59   0:00 postgres: 
11/main: background writer
postgres   849  0.0  0.0 213472  3688 ?Ss   09:59   0:00 postgres: 
11/main: walwriter
postgres   850  0.0  0.0 214012  5628 ?Ss   09:59   0:01 postgres: 
11/main: autovacuum launcher
postgres   852  0.0  0.4 102172 34612 ?Ss   09:59   0:10 postgres: 
11/main: stats collector
postgres   853  0.0  0.0 213880  4260 ?Ss   09:59   0:00 postgres: 
11/main: logical replication launcher
root  9652  0.0  0.0   6208   884 pts/1S+   15:06   0:00 grep postgres
root@deb10tp:~#





yes, I see your point. makes sense. the unix socket is actually also on 5433

root@deb10tp:~# grep -nr 543 /etc/postgresql
/etc/postgresql/11/main/postgresql.conf:63:port = 5433
root@deb10tp:~# find /var/run/postgresql/ | grep 543
/var/run/postgresql/.s.PGSQL.5433
/var/run/postgresql/.s.PGSQL.5433.lock
root@deb10tp:~#


Anyway, given these settings, "psql -p 5433 -h localhost" should
connect.  If you still get "connection refused" then you need to
look at the kernel firewall (packet filter) settings.

yes, with "-p 5433" I can connect


regards, tom lane

thanks



RE: Issues with using plpgsql debugger using PG13 on Centos 7

2021-03-31 Thread Jain, Ankit
Thank you for the pointer. We were able to build it correctly after setting the 
PG-13 path
PATH=$PATH:/usr/pgsql-13/bin

From: Ian Lawrence Barwick 
Sent: Tuesday, February 2, 2021 2:54 AM
To: Jain, Ankit 
Cc: pgsql-gene...@postgresql.org
Subject: Re: Issues with using plpgsql debugger using PG13 on Centos 7


CAUTION: This email originated from outside of Snap-on. Do not click on links 
or open attachments unless you have validated the sender, even if it is a known 
contact. Contact the sender by phone to validate the contents.
2021年2月2日(火) 12:06 Jain, Ankit 
mailto:ankit.j...@snapon.com>>:
(...)
But got the following error –
ERROR: could not load library "/usr/pgsql-13/lib/plugin_debugger.so": 
/usr/pgsql-13/lib/plugin_debugger.so: undefined symbol: LWLockAssign SQL state: 
58P01

Can you please help with getting the debugger working ?

It looks like the extension code was compiled against an older PostgreSQL
version (presumably 9.5 or earlier; LWLockAssign was removed in 9.6).

You'll need to make sure it's compiled against the major version you're using.

Regards

Ian Barwick

--
EnterpriseDB: 
https://www.enterprisedb.com<https://urldefense.com/v3/__https:/www.enterprisedb.com__;!!Lf_9VycLqA!wy8Xt5SI_nkVMC9Dq-R09xxO1WchcfRW8jcZjq4_qf8tzl1GQ5ZcajoSJQ1DY1M8$>