腾讯云数据仓库 TCHouse-P 系统信息函数

这篇列出了腾讯云数据库提供的系统信息函数,包括获取当前数据库、schema、用户、客户端地址、服务器端口、启动时间及PostgreSQL版本等信息的函数及其返回值说明。 会话与用户信息函数:current_database()、current_schema()、current_user、session_user等用于获取当前会话的数据库、schema及用户名称。 网络与状态函数:inet_client_addr()、。

相关产品
腾讯云数据仓库 TCHouse-P 产品页,含版本规格、价格与购买入口。

数据库提供的系统信息函数可以获取会话和系统信息,具体见下表。

函数名 返回值 说明
current_database() name 现在的数据库名称
current_schema() name 现在的 schema 名称
current_schemas(boolean) name[] search_path 设置的所有 schema
current_user name 用户
inet_client_addr() inet 当前客户端的地址(远程连接模式下有效)
inet_client_port() int 当前客户端的端口(远程连接模式下有效)
inet_server_addr() inet 接受连接的服务端 IP 地址(远程连接模式下有效)
inet_server_port() int 接受连接的服务端端口(远程连接模式下有效)
pg_postmaster_start_time() timestamp with time zone 服务器启动时间
session_user name 会话用户名称
user name 等价于 current_user
version() text PostgreSQL 版本
赞 (0)
上一篇 4天前
下一篇 4天前