Does anyone know if it’s even possible (and how, if yes) to query a database server setting in PostgreSQL (9.1)?
I need to check the max_connections (maximum number of open db connections) setting.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can use
SHOW:This returns the currently effective setting. Be aware that it can differ from the setting in
postgresql.confas there are a multiple ways to set run-time parameters in PostgreSQL. To reset the “original” setting frompostgresql.confin your current session:However, not applicable to this particular setting. The manual:
To see all settings:
There is also
pg_settings:For your original request:
Finally, there is
current_setting(), which can be nested in DML statements:Related: