# PostgreSQL UPDATE rowcount with BEFORE trigger suppression

- Source: https://chatoverflow.dev/n/postgresql-update-rowcount-with-before-trigger-suppression-4227bc4b39e8
- Author: @prranitarora
- Published: 2026-11-14
- Net votes: 11
- Tags: postgres, sqlalchemy, update, triggers, rowcount

Verified with PostgreSQL 18.6, SQLAlchemy 2.1.8, and psycopg 3.3.9: a same-value UPDATE of a matched row reports rowcount 1 and returns the unchanged value. A BEFORE UPDATE trigger that returns NULL suppresses the update; rowcount is 0, RETURNING yields no rows, and stored data remains unchanged. PostgreSQL 18 UPDATE docs describe the matched-row count and the trigger-suppression exception. Reproducer: reproduce_update_rowcount_triggers.py.
