SHOW — 显示一个运行时参数的值
SHOWnameSHOW ALL SHOWname%SHOW%nameSHOW%name%
SHOW将显示运行时参数的当前设置。
这些变量可以使用SET语句、编辑
lightdb.conf配置参数、通过
PGOPTIONS环境变量(使用
libpq或者基于libpq的应用时)
或者启动lightdb服务器时通过命令行
标志设置。详见Chapter 18。
name一个运行时参数的名称。可用的参数记录在 Chapter 18和SET参考页。此外,有一些可以显示但不能设置的参数:
SERVER_VERSION显示服务器的版本号。
LIGHTDB_SERVER_VERSION显示 LightDB 服务器的版本号。
LIGHTDB_SERVER_VERSION_NUM
显示 LightDB 服务器的版本号,其值为 major_version * 10000 + minor_version * 100。
SERVER_ENCODING显示服务器端的字符集编码。当前,这个参数可以被显示 但不能被设置,因为该设置是在数据库创建时决定的。
LC_COLLATE显示数据库的排序规则(文本序)的区域设置。当前, 这个参数可以被显示但不能被设置,因为该设置是在 数据库创建时决定的。
LC_CTYPE显示数据库的字符分类的区域设置。当前, 这个参数可以被显示但不能被设置,因为该设置 是在数据库创建时决定的。
IS_SUPERUSER如果当前角色具有超级用户特权则为真。
ALL显示所有配置参数的值,并带有描述。
name%显示所有以 name 开头的配置参数的值和描述。
%name显示所有以 name 结尾的配置参数的值和描述。
%name%显示所有包含 name 的配置参数的值和描述。
函数current_setting产生等效的输出,见
Section 10.26.1。还有,
pg_settings
系统事务产生同样的信息。
显示参数DateStyle的当前设置:
SHOW DateStyle; DateStyle ----------- ISO, MDY (1 row)
显示 LightDB 服务器版本:
SHOW lightdb_server_version; lightdb_server_version ------------------------ 13.8-25.2 (1 row)
显示 LightDB 服务器版本号:
SHOW lightdb_server_version_num; lightdb_server_version_num ---------------------------- 220400 (1 row)
显示所有设置:
SHOW ALL;
name | setting | description
-------------------------+---------+-------------------------------------------------
allow_system_table_mods | off | Allows modifications of the structure of ...
.
.
.
xmloption | content | Sets whether XML data in implicit parsing ...
zero_damaged_pages | off | Continues processing past damaged page headers.
(196 rows)
显示所有以参数 WAL% 开头的设置:
SHOW WAL%;
name | setting | description
-------------------------------+-----------+------------------------------------------------------------------------------------------------------------
wal_block_size | 8192 | Shows the block size in the write ahead log.
.
.
.
wal_writer_flush_after | 1MB | Amount of WAL written out by WAL writer that triggers a flush.
(19 rows)
显示所有以参数 %LEVEL 结尾的设置:
SHOW %LEVEL;
name | setting | description
----------------------------------+---------+-----------------------------------------------------------
auto_explain.log_level | log | Log level for the plan.
.
.
.
wal_level | replica | Set the level of information written to the WAL.
(7 rows)
显示所有包含参数 %FREEZE 的设置:
SHOW %_FREEZE_%;
name | setting | description
-------------------------------------+-----------+-------------------------------------------------------------------------------
autovacuum_freeze_max_age | 200000000 | Age at which to autovacuum a table to prevent transaction ID wraparound.
.
.
.
vacuum_multixact_freeze_table_age | 150000000 | Multixact age at which VACUUM should scan whole table to freeze tuples.
(6 rows)
SHOW命令是一种
LightDB扩展。