Postgresql: how to create table only if it does not already exist?

后端 未结 10 955
不思量自难忘°
不思量自难忘° 2021-01-31 08:04

In Postgresql, how can I do a condition to create a table only if it does not already exist?

Code example appreciated.

10条回答
  •  南笙
    南笙 (楼主)
    2021-01-31 08:13

    http://www.postgresql.org/docs/8.2/static/sql-droptable.html

    DROP TABLE [ IF EXISTS ] name [, ...] [ CASCADE | RESTRICT ]
    

提交回复
热议问题