quix-labs / flash

Go library for managing real-time PostgreSQL changes.
MIT License
47 stars 6 forks source link

[Compatibility] Trigger driver CREATE OR REPLACE command #3

Closed spencerswagger closed 3 months ago

spencerswagger commented 3 months ago

When initing listeners by trigger driver, driver is going to execute CREATE OR REPLACE FUNCTION and CREATE OR REPLACE TRIGGER. OR REPLACE command is supported by postgresql since 14. Use DROP TRIGGER IF EXISTS and CREATE TRIGGER instead of CREATE OR REPLACE TRIGGER

alancolant commented 3 months ago

Thank you for this PR, could you add a comment to explain why these 2 operations instead of the replace?