【Data Platform】/Postgresql

[9.2] Run-time Parameter 확인

디비랑 2013. 7. 9. 19:49

/********************************************************************************************
-- Title : [9.2] Run-time Parameter 확인
-- Reference : postgresql.org
-- Key word : pg_setting setting parameter 파라미터 parameters current-setting show
********************************************************************************************/

-- 확인
    postgres=# show all
    postgres=# show wal_levle;
    postgres=# select * from pg_settings;
    postgres=# select name, setting from pg_settings
                    where name = 'wal_level';
    postgres=# select current_setting('wal_level');

-- 수정
    ㅇ current_setting('parameter_name', 'new_value', is_local)로 수정
    ㅇ is_local은 현재 트랜잭션만 적용시 true, 현재 세션 적용시 false값 적용

    postgres=# select current_setting('datestyle');
    current_setting
    -----------------
     ISO, MDY

    postgres=# select set_config('log_statement_stats', 'off', false);
     set_config
    ------------
     off


-- 참조
    ㅇ pg_settings : http://www.postgresql.org/docs/9.2/static/view-pg-settings.html
    ㅇ show : http://www.postgresql.org/docs/9.2/static/sql-show.html
    ㅇ current_setting : http://www.postgresql.org/docs/9.2/static/functions-admin.html