Postgresql 中文操作指南

SET CONNECTION

SET CONNECTION — 选择一个数据库连接

SET CONNECTION — select a database connection

Synopsis

SET CONNECTION [ TO | = ] connection_name

Description

SET CONNECTION 设置“当前”数据库连接,所有命令都会使用该连接,除非被覆盖。

SET CONNECTION sets the “current” database connection, which is the one that all commands use unless overridden.

Parameters

  • connection_name #

    • A database connection name established by the CONNECT command.

  • CURRENT #

    • Set the connection to the current connection (thus, nothing happens).

Examples

EXEC SQL SET CONNECTION TO con2;
EXEC SQL SET CONNECTION = con1;

Compatibility

SET CONNECTION 在 SQL 标准中进行了规定。

SET CONNECTION is specified in the SQL standard.