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

时间:2025-02-12 15:06:10

查看数据库中包含的表

在public Schema下新建以下表格。
gaussdb=#  CREATE TABLE public.search_table_t1(a int) distribute by hash(a);CREATE TABLEgaussdb=#  CREATE TABLE public.search_table_t2(b int) distribute by hash(b);CREATE TABLEgaussdb=#  CREATE TABLE public.search_table_t3(c int) distribute by hash(c);CREATE TABLEgaussdb=#  CREATE TABLE public.search_table_t4(d int) distribute by hash(d);CREATE TABLEgaussdb=#  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%';
结果如下:
12345678
    tablename----------------- search_table_t1 search_table_t2 search_table_t3 search_table_t4 search_table_t5(5 rows)
support.huaweicloud.com/distributed-devg-v3-gaussdb/gaussdb-12-0033.html