Skip to content

Instantly share code, notes, and snippets.

@grantpullen
Created August 1, 2018 10:33
Show Gist options
  • Save grantpullen/8912e0e2d5cf8199d05052763d65b9db to your computer and use it in GitHub Desktop.
Save grantpullen/8912e0e2d5cf8199d05052763d65b9db to your computer and use it in GitHub Desktop.
Postgres Update & View config directly via SQL
-- Show current settings...
show config_file
show max_connections
show log_min_duration_statement
show log_directory
show data_directory
-- more detailed info on current settings...
select * from pg_settings where name='max_connections';
-- update setting via sql
ALTER SYSTEM SET max_connections = 202;
ALTER SYSTEM SET log_min_duration_statement = '200'
-- reload settings... only apples to settings that support hot reload...
select pg_reload_conf()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment