合 PG视图pg_settings、pg_file_settings、pg_hba_file_rules简介
Tags: PG系统视图pg_file_settingspg_hba_file_rulespg_settings
👉 本文共约4363个字,系统预计阅读时间或需17分钟。
pg_settings
视图pg_settings
提供了对服务器上运行时参数的访问。它本质上是SHOW和SET命令的可替换接口。它还提供了SHOW
不能提供的关于每一个参数的一些现实,例如最大值和最小值。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 | lhrdb=# select * from pg_settings; name | setting | unit | category | short_desc | extra_desc | context | vartype | source | min_val | max_val | enumvals | boot_val | reset_val | sourcefile | sourceline | pending_restart ----------------------------------------+------------------------------+------+-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------+---------+----------------------+-------------+--------------+--------------------------------------------------------------------------------+--------------------------------+------------------------------+------------------------------+------------+----------------- allow_system_table_mods | off | | Developer Options | Allows modifications of the structure of system tables. | | superuser | bool | default | | | | off | off | | | f application_name | psql | | Reporting and Logging / What to Log | Sets the application name to be reported in statistics and logs. | | user | string | client | | | | | psql | | | f archive_cleanup_command | | | Write-Ahead Log / Archive Recovery | Sets the shell command that will be executed at every restart point. | | sighup | string | default | | | | | | | | f archive_command | (disabled) | | Write-Ahead Log / Archiving | Sets the shell command that will be called to archive a WAL file. | | sighup | string | default | | | | | | | | f archive_mode | off | | Write-Ahead Log / Archiving | Allows archiving of WAL files using archive_command. | | postmaster | enum | default | | | {always,on,off} | off | off | | | f archive_timeout | 0 | s | Write-Ahead Log / Archiving | Forces a switch to the next WAL file if a new file has not been started within N seconds. | | sighup | integer | default | 0 | 1073741823 | | 0 | 0 | | | f array_nulls | on | | Version and Platform Compatibility / Previous PostgreSQL Versions | Enable input of NULL elements in arrays. | When turned on, unquoted NULL in an array input value means a null value; otherwise it is taken literally. | user | bool | default | | | | on | on | | | f authentication_timeout | 60 | s | Connections and Authentication / Authentication | Sets the maximum allowed time to complete client authentication. | | sighup | integer | default | 1 | 600 | | 60 | 60 | | | f autovacuum | on | | Autovacuum | Starts the autovacuum subprocess. | | sighup | bool | default | | | | on | on | | | f autovacuum_analyze_scale_factor | 0.1 | | Autovacuum | Number of tuple inserts, updates, or deletes prior to analyze as a fraction of reltuples. | | sighup | real | default | 0 | 100 | | 0.1 | 0.1 | | | f autovacuum_analyze_threshold | 50 | | Autovacuum | Minimum number of tuple inserts, updates, or deletes prior to analyze. | | sighup | integer | default | 0 | 2147483647 | | 50 | 50 | | | f autovacuum_freeze_max_age | 200000000 | | Autovacuum | Age at which to autovacuum a table to prevent transaction ID wraparound. | | postmaster | integer | default | 100000 | 2000000000 | | 200000000 | 200000000 | | | f autovacuum_max_workers | 3 | | Autovacuum | Sets the maximum number of simultaneously running autovacuum worker processes. | | postmaster | integer | default | 1 | 262143 | | 3 | 3 | | | f autovacuum_multixact_freeze_max_age | 400000000 | | Autovacuum | Multixact age at which to autovacuum a table to prevent multixact wraparound. | | postmaster | integer | default | 10000 | 2000000000 | | 400000000 | 400000000 | | | f autovacuum_naptime | 60 | s | Autovacuum | Time to sleep between autovacuum runs. | | sighup | integer | default | 1 | 2147483 | | 60 | 60 | | | f autovacuum_vacuum_cost_delay | 2 | ms | Autovacuum | Vacuum cost delay in milliseconds, for autovacuum. | | sighup | real | default | -1 | 100 | | 2 | 2 | | | f autovacuum_vacuum_cost_limit | -1 | | Autovacuum | Vacuum cost amount available before napping, for autovacuum. | | sighup | integer | default | -1 | 10000 | | -1 | -1 | | | f autovacuum_vacuum_insert_scale_factor | 0.2 | | Autovacuum | Number of tuple inserts prior to vacuum as a fraction of reltuples. | | sighup | real | default | 0 | 100 | | 0.2 | 0.2 | | | f autovacuum_vacuum_insert_threshold | 1000 | | Autovacuum | Minimum number of tuple inserts prior to vacuum, or -1 to disable insert vacuums. | | sighup | integer | default | -1 | 2147483647 | | 1000 | 1000 | | | f autovacuum_vacuum_scale_factor | 0.2 | | Autovacuum | Number of tuple updates or deletes prior to vacuum as a fraction of reltuples. | | sighup | real | default | 0 | 100 | | 0.2 | 0.2 | | | f autovacuum_vacuum_threshold | 50 | | Autovacuum | Minimum number of tuple updates or deletes prior to vacuum. | | sighup | integer | default | 0 | 2147483647 | | 50 | 50 | | | f autovacuum_work_mem | -1 | kB | Resource Usage / Memory | Sets the maximum memory to be used by each autovacuum worker process. | | sighup | integer | default | -1 | 2147483647 | | -1 | -1 | | | f backend_flush_after | 0 | 8kB | Resource Usage / Asynchronous Behavior | Number of pages after which previously performed writes are flushed to disk. | | user | integer | default | 0 | 256 | | 0 | 0 | | | f backslash_quote | safe_encoding | | Version and Platform Compatibility / Previous PostgreSQL Versions | Sets whether "\'" is allowed in string literals. | | user | enum | default | | | {safe_encoding,on,off} | safe_encoding | safe_encoding | | | f backtrace_functions | | | Developer Options | Log backtrace for errors in these functions. | | superuser | string | default | | | | | | | | f bgwriter_delay | 200 | ms | Resource Usage / Background Writer | Background writer sleep time between rounds. | | sighup | integer | default | 10 | 10000 | | 200 | 200 | | | f bgwriter_flush_after | 64 | 8kB | Resource Usage / Background Writer | Number of pages after which previously performed writes are flushed to disk. | | sighup | integer | default | 0 | 256 | | 64 | 64 | | | f bgwriter_lru_maxpages | 100 | | Resource Usage / Background Writer | Background writer maximum number of LRU pages to flush per round. | | sighup | integer | default | 0 | 1073741823 | | 100 | 100 | | | f bgwriter_lru_multiplier | 2 | | Resource Usage / Background Writer | Multiple of the average buffer usage to free per round. | | sighup | real | default | 0 | 10 | | 2 | 2 | | | f block_size | 8192 | | Preset Options | Shows the size of a disk block. | | internal | integer | default | 8192 | 8192 | | 8192 | 8192 | | | f bonjour | off | | Connections and Authentication / Connection Settings | Enables advertising the server via Bonjour. | | postmaster | bool | default | | | | off | off | | | f bonjour_name | | | Connections and Authentication / Connection Settings | Sets the Bonjour service name. | | postmaster | string | default | | | | | | | | f bytea_output | hex | | Client Connection Defaults / Statement Behavior | Sets the output format for bytea. | | user | enum | default | | | {escape,hex} | hex | hex | | | f check_function_bodies | on | | Client Connection Defaults / Statement Behavior | Check function bodies during CREATE FUNCTION. | | user | bool | default | | | | on | on | | | f checkpoint_completion_target | 0.5 | | Write-Ahead Log / Checkpoints | Time spent flushing dirty buffers during checkpoint, as fraction of checkpoint interval. | | sighup | real | default | 0 | 1 | | 0.5 | 0.5 | | | f checkpoint_flush_after | 32 | 8kB | Write-Ahead Log / Checkpoints | Number of pages after which previously performed writes are flushed to disk. | | sighup | integer | default | 0 | 256 | | 32 | 32 | | | f checkpoint_timeout | 300 | s | Write-Ahead Log / Checkpoints | Sets the maximum time between automatic WAL checkpoints. | | sighup | integer | default | 30 | 86400 | | 300 | 300 | | | f checkpoint_warning | 30 | s | Write-Ahead Log / Checkpoints | Enables warnings if checkpoint segments are filled more frequently than this. | Write a message to the server log if checkpoints caused by the filling of checkpoint segment files happens more frequently than this number of seconds. Zero turns off the warning. | sighup | integer | default | 0 | 2147483647 | | 30 | 30 | | | f client_encoding | GBK | | Client Connection Defaults / Locale and Formatting | Sets the client's character set encoding. | | user | string | client | | | | SQL_ASCII | GBK | | | f client_min_messages | notice | | Client Connection Defaults / Statement Behavior | Sets the message levels that are sent to the client. | Each level includes all the levels that follow it. The later the level, the fewer messages are sent. | user | enum | default | | | {debug5,debug4,debug3,debug2,debug1,log,notice,warning,error} | notice | notice | | | f cluster_name | | | Process Title | Sets the name of the cluster, which is included in the process title. | | postmaster | string | default | | | | | | | | f commit_delay | 0 | | Write-Ahead Log / Settings | Sets the delay in microseconds between transaction commit and flushing WAL to disk. | | superuser | integer | default | 0 | 100000 | | 0 | 0 | | | f commit_siblings | 5 | | Write-Ahead Log / Settings | Sets the minimum concurrent open transactions before performing commit_delay. | | user | integer | default | 0 | 1000 | | 5 | 5 | | | f config_file | /pg13/pgdata/postgresql.conf | | File Locations | Sets the server's main configuration file. | | postmaster | string | override | | | | | /pg13/pgdata/postgresql.conf | | | f constraint_exclusion | partition | | Query Tuning / Other Planner Options | Enables the planner to use constraints to optimize queries. | Table scans will be skipped if their constraints guarantee that no rows match the query. | user | enum | default | | | {partition,on,off} | partition | partition | | | f cpu_index_tuple_cost | 0.005 | | Query Tuning / Planner Cost Constants | Sets the planner's estimate of the cost of processing each index entry during an index scan. | | user | real | default | 0 | 1.79769e+308 | | 0.005 | 0.005 | | | f cpu_operator_cost | 0.0025 | | Query Tuning / Planner Cost Constants | Sets the planner's estimate of the cost of processing each operator or function call. | | user | real | default | 0 | 1.79769e+308 | | 0.0025 | 0.0025 | | | f cpu_tuple_cost | 0.01 | | Query Tuning / Planner Cost Constants | Sets the planner's estimate of the cost of processing each tuple (row). | | user | real | default | 0 | 1.79769e+308 | | 0.01 | 0.01 | | | f cursor_tuple_fraction | 0.1 | | Query Tuning / Other Planner Options | Sets the planner's estimate of the fraction of a cursor's rows that will be retrieved. | | user | real | default | 0 | 1 | | 0.1 | 0.1 | | | f data_checksums | on | | Preset Options | Shows whether data checksums are turned on for this cluster. | | internal | bool | override | | | | off | on | | | f data_directory | /pg13/pgdata | | File Locations | Sets the server's data directory. | | postmaster | string | override | | | | | /pg13/pgdata | | | f data_directory_mode | 0700 | | Preset Options | Mode of the data directory. | The parameter value is a numeric mode specification in the form accepted by the chmod and umask system calls. (To use the customary octal format the number must start with a 0 (zero).) | internal | integer | default | 0 | 511 | | 448 | 448 | | | f data_sync_retry | off | | Error Handling | Whether to continue running after a failure to sync data files. | | postmaster | bool | default | | | | off | off | | | f DateStyle | ISO, MDY | | Client Connection Defaults / Locale and Formatting | Sets the display format for date and time values. | Also controls interpretation of ambiguous date inputs. | user | string | configuration file | | | | ISO, MDY | ISO, MDY | /pg13/pgdata/postgresql.conf | 678 | f db_user_namespace | off | | Connections and Authentication / Authentication | Enables per-database user names. | | sighup | bool | default | | | | off | off | | | f deadlock_timeout | 1000 | ms | Lock Management | Sets the time to wait on a lock before checking for deadlock. | | superuser | integer | default | 1 | 2147483647 | | 1000 | 1000 | | | f debug_assertions | off | | Preset Options | Shows whether the running server has assertion checks enabled. | | internal | bool | default | | | | off | off | | | f debug_pretty_print | on | | Reporting and Logging / What to Log | Indents parse and plan tree displays. | | user | bool | default | | | | on | on | | | f debug_print_parse | off | | Reporting and Logging / What to Log | Logs each query's parse tree. |   |