Skip to content

Conversation

@enobayram
Copy link
Contributor

Before this PR, the DROP TRIGGER statements used for dropping Postgres triggers was generated by the base.Trigger, which doesn't attempt any quoting. This behavior was inconsistent with postgresql.Trigger.to_sql_create, which does add quotes in the CREATE TRIGGER ... ON ... statement. In practice, lack of quoting in the drop statement was causing issues for tables with special names, like "user".

@codecov
Copy link

codecov bot commented Aug 16, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.81%. Comparing base (14c83ae) to head (a064fae).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #121      +/-   ##
==========================================
- Coverage   89.83%   89.81%   -0.02%     
==========================================
  Files          86       86              
  Lines        4052     4054       +2     
  Branches      841      841              
==========================================
+ Hits         3640     3641       +1     
- Misses        335      336       +1     
  Partials       77       77              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@DanCardin
Copy link
Owner

Do you mind adding a test with e.g. table named "user" as you call out?

@enobayram
Copy link
Contributor Author

Sure!

@enobayram
Copy link
Contributor Author

@DanCardin I've extended the existing test_drop_postgres test case with a table and a trigger requiring quoted identifiers. Please let me know if you'd specifically prefer a new test case.

@DanCardin DanCardin force-pushed the quoting-in-postgres-drop-trigger branch from fb8dd4b to a064fae Compare August 18, 2025 19:55
@DanCardin
Copy link
Owner

Nope that's fine. Thanks for the fix(es)!

@DanCardin DanCardin merged commit 4ea6f90 into DanCardin:main Aug 18, 2025
18 of 19 checks passed
@enobayram
Copy link
Contributor Author

And thank you for reviewing and merging them!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants