cockroachdb / cockroachdb/cockroach

sql: add support for UPDATE triggers with column list

Open
#135,656 0 comments 0 reactions 0 assignees View on GitHub
A-sql-pgcompat A-sql-trigger C-enhancement docs-known-limitation T-sql-queries X-anchored-telemetry
Dominant language
Go
Stars
32.5k
Forks
4.1k
PR merge metrics
PR metrics pending

Description

This is a tracking issue for specifying a column list for an UPDATE trigger. From the Postgres docs:
>A column-specific trigger (one defined using the UPDATE OF column_name syntax) will fire when any of its columns are listed as targets in the UPDATE command's SET list. It is possible for a column's value to change even when the trigger is not fired, because changes made to the row's contents by BEFORE UPDATE triggers are not considered. Conversely, a command such as UPDATE ... SET x = x ... will fire a trigger on column x, even though the column's value did not change.

Epic: [CRDB-347](https://cockroachlabs.atlassian.net/browse/CRDB-347)

Jira issue: CRDB-44666

Epic CRDB-347

Contributor guide

Open the contributing guide

Research direction

Start by locating CockroachDB's existing UPDATE trigger implementation and any tests covering trigger firing. Compare its behavior with the quoted PostgreSQL rules for UPDATE OF column lists, including SET targets and unchanged values. Done means column-specific UPDATE triggers follow those semantics; the issue provides no file or test names, so repository exploration is required.

Written by the indexing model from the issue text.

Assessment

Tech stack
sql
Domain
databases
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.