删除普通表
 
                  更新时间 2025-02-05 09:37:14
                 
 
                    最近更新时间: 2025-02-05 09:37:14
                  
 本页为您介绍如何删除普通表。
 CREATE TABLE test1 (a int, b text);
CREATE TABLE test2 (a int, b text);
insert into test1 values (1, ‘Milly’), (2, ‘Kong’),(3, ‘Piccy’);
insert into test2 values (1, ‘Milly’), (2, ‘Kong’),(3, ‘Piccy’);
DROP TABLE test1;
\dt public.*
         List of relations
 Schema | Name  | Type  |  Owner   
--------+-------+-------+----------
 public | test2 | table | teledb
(1 row)
\dt "trash".*
            List of relations
 Schema |    Name     | Type  |  Owner   
--------+-------------+-------+----------
 trash  | _1       | table | teledb
 trash  | trash_table | table | teledb
(2 rows)
DROP TABLE test2;
\dt "trash".*
            List of relations
 Schema |    Name     | Type  |  Owner   
--------+-------------+-------+----------
 trash  | _1          | table | teledb
 trash  | _2          | table | teledb
 trash  | trash_table | table | teledb
(3 rows)
SELECT org_relname, new_relname, org_nspname, relowner FROM trash.trash_table;
 org_relname | new_relname | org_nspname | relowner 
-------------+-------------+-------------+----------
 test1       | _1          | public      | teledb
 test2       | _2          | public      | teledb
(2 rows)