USE db_name

功能描述

连接到当前数据库。

注意事项

  • 仅支持USE当前连接的数据库,不支持连接到其他数据库。若USE的数据库名不是当前数据库,则报错。

语法格式

USE db_name

参数说明

  • db_name

    ​ 数据库名。

示例

create database testd with dbcompatibility = 'd';
\c testd
create extension shark;

use testd;
NOTICE:  Already connected to database 'testd'.

use test1;
ERROR:  Use of non-current database 'test1' is not supported.

相关链接

N/A

意见反馈
编组 3备份
    openGauss 2025-09-13 07:42:33
    取消