Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

in postgres, can one query the current listeners?

in the notify / listen for postgres, one listens through

listen channel

is there a way to query the current channels to which the session is listening?

have gone through doc with luck as yet.

like image 722
cc young Avatar asked Apr 14 '15 09:04

cc young


People also ask

How do I find active sessions in PostgreSQL?

SELECT * FROM pg_stat_activity WHERE datname = 'dbname' and state = 'active'; Since pg_stat_activity contains connection statistics of all databases having any state, either idle or active , database name and connection state should be included in the query to get the desired output. Save this answer.

How many queries per second PostgreSQL can handle?

In terms of business transactions, each business transactions is around 30-35 queries hitting the database. We are able to achieve ~ 150 business transactions with 4,500-5,000 QPS ( query per second ).

Do Postgres views update automatically?

Updatable Views. Simple views are automatically updatable: the system will allow INSERT , UPDATE and DELETE statements to be used on the view in the same way as on a regular table.

How does SELECT query work in PostgreSQL?

The PostgreSQL SELECT statement retrieves data from a single or several tables in a database, and returns the data in a result table, called a result-set. Use the SELECT statement to return one or more rows matching the specified criteria from the database tables.


1 Answers

select * 
from pg_listening_channels() 

This is listed in the chapter "System Information Functions":

http://www.postgresql.org/docs/current/static/functions-info.html

like image 155
a_horse_with_no_name Avatar answered Sep 20 '22 13:09

a_horse_with_no_name