云数据库 GAUSSDB-查看系统表:查看数据库中包含的表

时间:2024-11-13 14:46:10

查看数据库中包含的表

在public Schema下新建五张表:
gaussdb=#  CREATE TABLE public.search_table_t1(a int) distribute by hash(a);
CREATE TABLE
gaussdb=#  CREATE TABLE public.search_table_t2(b int) distribute by hash(b);
CREATE TABLE
gaussdb=#  CREATE TABLE public.search_table_t3(c int) distribute by hash(c);
CREATE TABLE
gaussdb=#  CREATE TABLE public.search_table_t4(d int) distribute by hash(d);
CREATE TABLE
gaussdb=#  CREATE TABLE public.search_table_t5(e int) distribute by hash(e);
CREATE TABLE
PG_TABLES系统表中查看public Schema中包含的前缀为search_table的表:
1
gaussdb=#  SELECT distinct(tablename) FROM pg_tables WHERE SCHEMANAME = 'public' AND TABLENAME LIKE 'search_table%';
结果如下:
1
2
3
4
5
6
7
8
    tablename
-----------------
 search_table_t1
 search_table_t2
 search_table_t3
 search_table_t4
 search_table_t5
(5 rows)
support.huaweicloud.com/distributed-devg-v8-gaussdb/gaussdb-12-0033.html