bug: ERROR: syntax error at or near "TRIGGER"

Open
#5,802 2 comments 0 reactions 1 assignee View on GitHub

@rubenfiszel is already working on this.

Since May 22, 2025.

Assessment

This issue has not been assessed yet.

Description

bug
Describe the bug

Hey
I'm trying to run the tool for the first time pointing to an external postgres database. Even after all the steps in the database-related documentation, I came across this error.

SQL Error [42601]: ERROR: syntax error at or near "TRIGGER"
  Position: 23

Error position: line: 1 pos: 22

This error happens when we the migration 20231002123723_notify_delete_config.up.sql is executed.

happens because of incorrect usage of double quotes (") around the trigger name in the CREATE TRIGGER statement.

This way works fine

CREATE FUNCTION notify_global_setting_delete()
RETURNS TRIGGER AS $$
BEGIN
    PERFORM pg_notify('notify_global_setting_change', OLD.name::text);
    RETURN OLD;
END;
$$ LANGUAGE plpgsql;

CREATE TRIGGER notify_global_setting_delete
AFTER DELETE ON global_settings
FOR EACH ROW
EXECUTE FUNCTION notify_global_setting_delete();
To reproduce
  1. Point the windmill to use an external db (https://www.windmill.dev/docs/advanced/self_host#use-an-external-database)
  2. Try to up the service
Expected behavior

Migrations executed without error

Screenshots

No response

Browser information

No response

Application version

CE v1.491.5-17-g6e3613641

Additional Context

No response

Dominant language
Rust
Stars
18k
Forks
1.1k
Avg merge
1d 1h
Merged PRs (30d)
328

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from windmill-labs/windmill

All issues in windmill-labs/windmill

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.