0

With SESSION and LOCAL below, I cannot set a parameter persistently in PostgreSQL:

SET SESSION log_statement = 'all'
SET LOCAL log_statement = 'all'

Actually with PERSIST and GLOBAL below in MySQL, I can set a parameter persistently and semi-persistently respectively:

SET PERSIST transaction_isolation = 'READ-UNCOMMITTED';
SET GLOBAL transaction_isolation = 'READ-COMMITTED';

So, are there any ways to set a parameter persistently by a query in PostgreSQL?

1 Answer 1

0

You need to use ALTER SYSTEM if you want to change it globally for all databases and users. Or change it in postgresql.conf.
Note that you need to reload the configuration if you do that (depending on the parameter you might even need to restart Postgres completely - this is documented for each property)

If you only want to change it for a specific database, use ALTER DATABASE

If you only want to change it for a user, use ALTER USER

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.