IS DISTINCT FROM: Comparing NULLs Without the Headache
It usually shows up in a code review. Someone writes a filter that is supposed to exclude voided rows, it looks completely reasonable, and yet a tester swears that records are going missing. The query…
COMMIT, ROLLBACK, and Autocommit: PostgreSQL Transactions for SQL Server DBAs
SQL Server DBAs lean on the ‘run to the SELECT, then COMMIT or ROLLBACK by hand’ workflow. PostgreSQL’s autocommit, abort-on-error, and plpgsql change the rules. Here is how to get the same safety and diagnostics in psql and pgAdmin.
Stop Disabling Foreign Keys: Use a Topological Sort Instead
You inherit a PostgreSQL cleanup script. The very first line is:
|
1 |
SET SESSION_REPLICATION_ROLE TO REPLICA; |
It works. Every table gets wiped clean, no FK errors, no complaints. Then one day somebody adds a new table to the schema,…
The psqlODBC Driver Is Eating Your RAISE NOTICE Messages
I just spent two days debugging a problem where my PowerShell script was logging 900 lines of output instead of 150. The script worked fine for months. Then someone added more tables to the process,…
Pick a Convention and Stick With It
You know what’s worse than a bad naming convention? Two naming conventions in the same database. I ran into this last week while writing a verification query for a PostgreSQL database. The query is a…