windmill-labs / windmill-helm-charts

50 stars 34 forks source link

Upgrade using 1.181 images not work #43

Closed cyrilbkr closed 1 year ago

cyrilbkr commented 1 year ago

HI guys,

I m trying to use the latest Windmill docker image with this Helm chart but it crash

Error: Migrating database: while executing migrations: error returned from database: syntax error at or near "TRIGGER"   

Can you help please ?

rubenfiszel commented 1 year ago

What version of postgres or cloud are you using ? It sounds like your database doesn't support trigger for some reasons

cyrilbkr commented 1 year ago

Thanks for you reply,

I m using AWS RDS Aurora PostgreSQL 13.8

rubenfiszel commented 1 year ago

Those are the trigger that are required to implement instant propagations of the configs:


CREATE FUNCTION "notify_config_change" ()
RETURNS TRIGGER AS $$
BEGIN
    PERFORM pg_notify('notify_config_change', NEW.name::text);
    RETURN NEW;
END;
$$ LANGUAGE PLPGSQL;

  CREATE TRIGGER "notify_config_change"
 AFTER INSERT OR UPDATE ON "config"
    FOR EACH ROW
EXECUTE FUNCTION "notify_config_change" ();

CREATE FUNCTION "notify_global_setting_change" ()
RETURNS TRIGGER AS $$
BEGIN
    PERFORM pg_notify('notify_global_setting_change', NEW.name::text);
    RETURN NEW;
END;
$$ LANGUAGE PLPGSQL;

  CREATE TRIGGER "notify_global_setting_change"
 AFTER INSERT OR UPDATE ON "global_settings"
    FOR EACH ROW
EXECUTE FUNCTION "notify_global_setting_change" ();

you could try running them by hand in psql and check that indeed aurora doesn't support it

cyrilbkr commented 1 year ago

Ok it works after upgrading to Postgre 14.5 ! CREATE OR REPLACE TRIGGER works only starting Aurora Postgresql 14. Thanks !