Postgresql: Check if Schema Exists?

前端 未结 10 1573
星月不相逢
星月不相逢 2021-02-01 12:24

I need to create, manage and drop schemas on the fly. If I go to create a schema that already exists, I want to (conditionally, via external means) drop and recreate it as speci

10条回答
  •  长发绾君心
    2021-02-01 12:50

    This is valid for the PostgreSQL that will check if the schema if exist and if not then will create it:

    CREATE SCHEMA IF NOT EXISTS tenant;
    

提交回复
热议问题