Postgresql: Check if Schema Exists?

前端 未结 10 1664
星月不相逢
星月不相逢 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:28

    This one worked for me (Postgres 9.3):

    Select exists (SELECT 1 FROM information_schema.schemata where catalog_name = 'My_BD_with_UpperCase_characters_in_its_Name')
    

提交回复
热议问题