Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sql: match PG error when dropping non-existent trigger #135759

Merged
merged 1 commit into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading