Posgres triggers in transactions. I write a script that begins, modifies a row, which fires a the trigger, then selects the column modified by the trigger. It was modified. (In psql, autocommit=off.) Run exactly the same queries inside my app and the trigger doesn't fire. Why?
FWIW I think using `CURRENT_TIMESTAMP` is what users would expect. Assuming you're testing the trigger in general, and not that it's created for specific tables, you can test by creating a new table in the test outside a transaction. https://github.com/diesel-rs/diesel/blob/50798e5dd52ae9d3c7c9a4bf7a5f1e5b9167aba3/diesel_tests/tests/connection.rs#L12-L75 …
-
-
I agree that using CURRENT_TIMESTAMP is the most sensible. I guess I can write this test to use raw SQL, create the temporary table like you suggest, but `drop table if exists` first to clean up any that get left over from previous test runs.
- 3 more replies
New conversation
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.