Create or replace trigger postgres

后端 未结 5 640
情话喂你
情话喂你 2021-02-02 05:01

I want to \"create or replace\" a trigger for a postgres table. However, there is not such sql expression.

I see that I can do a \"DROP TRIGGER IF EXISTS\"

5条回答
  •  攒了一身酷
    2021-02-02 05:28

    Postgresql has transaction DDL so BEGIN > DROP > CREATE > COMMIT is the equivalent of CREATE OR REPLACE

    This is a nice write-up of how postgre's transactional DDL compares to other systems (such as oracle)

    Current postgres planned features regarding triggers do not include adding the REPLACE syntax.

提交回复
热议问题