Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
135759: sql: match PG error when dropping non-existent trigger r=yuzefovich a=yuzefovich

Found in pg_regress (which we'll update separately).

Informs: cockroachdb#132515
Epic: None

Release note: None

Co-authored-by: Yahor Yuzefovich <[email protected]>
  • Loading branch information
craig[bot] and yuzefovich committed Nov 20, 2024
2 parents 8cdc891 + 5af8ac6 commit d78b1db
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/ccl/logictestccl/testdata/logic_test/triggers
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,7 @@ statement ok
DROP TRIGGER bar ON xy;

# Dropping a nonexistent trigger is an error.
statement error pgcode 42704 pq: trigger "foo" of relation "xy" does not exist
statement error pgcode 42704 pq: trigger "foo" for table "xy" does not exist
DROP TRIGGER foo ON xy;

# The IF EXISTS syntax allows dropping a nonexistent trigger without error.
Expand Down
2 changes: 1 addition & 1 deletion pkg/sql/sqlerrors/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ func NewUndefinedConstraintError(constraintName, tableName string) error {
// NewUndefinedTriggerError returns a missing constraint error.
func NewUndefinedTriggerError(triggerName, tableName string) error {
return pgerror.Newf(pgcode.UndefinedObject,
"trigger %q of relation %q does not exist", triggerName, tableName)
"trigger %q for table %q does not exist", triggerName, tableName)
}

// NewRangeUnavailableError creates an unavailable range error.
Expand Down

0 comments on commit d78b1db

Please sign in to comment.