Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

workflow for psql usage #2

Open
fluca1978 opened this issue Jun 4, 2021 · 1 comment
Open

workflow for psql usage #2

fluca1978 opened this issue Jun 4, 2021 · 1 comment

Comments

@fluca1978
Copy link

This is not really an issue, rather a question about how to use the extension from psql.
I've installed it on server 13.3, and in one session I've done:

pgbench=# set client_min_messages to debug;
SET
pgbench=# select pg_backend_pid(), pldbg_create_listener();
DEBUG:  listening for debugging target at port 46089
 pg_backend_pid | pldbg_create_listener 
----------------+-----------------------
           3690 |                     3
(1 row)

then on another session I tried to connect to such port:

pgbench=> select pg_backend_pid();
 pg_backend_pid 
----------------
           4773
(1 riga)

pgbench=> select pldbg_attach_to_port( 46089 );
ERROR:  target backend is not listening for a connection

effectively I don't have the port opened in the localhost, so I guess I'm doing something wrong:

% nmap localhost
Starting Nmap 7.70 ( https://nmap.org ) at 2021-06-04 07:28 EDT
Nmap scan report for localhost (127.0.0.1)
Host is up (0.0010s latency).
Other addresses for localhost (not scanned): ::1
Not shown: 998 closed ports
PORT     STATE SERVICE
22/tcp   open  ssh
5432/tcp open  postgresql

Anyone could please provide some info about how to "initialize" the listener and the proxy connections?

@fluca1978
Copy link
Author

Is there a way to use this extension to debug a function outside pgadmin?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant