6

In another question, it was asked how to query a postgresql runtime parameter (e.g. SHOW search_path;) using a SELECT query. In the answer, it was suggested to use

SELECT * FROM pg_settings WHERE name = 'search_path';

This works great, but how can this be done for custom parameters defined in an extension? (See docs about Customized Options).

Example:

SET abc.my_var = 1;
SHOW abc.my_var;

outputs

1

but

SELECT * FROM pg_settings WHERE name = 'abc.my_var';

returns no rows. Is there some other table/view I can query for my custom parameter using a SELECT statement?

0

1 Answer 1

5

Use the function current_setting()

SELECT current_setting('abc.my_var');

http://www.postgresql.org/docs/current/static/functions-admin.html#FUNCTIONS-ADMIN-SET

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.