Skip to content

Instantly share code, notes, and snippets.

/* Make a trigger to count rows in a table */
CREATE TABLE rowcount (
table_name text NOT NULL,
total_rows bigint,
PRIMARY KEY (table_name));
CREATE OR REPLACE FUNCTION count_rows()
RETURNS TRIGGER AS
'