-
Notifications
You must be signed in to change notification settings - Fork 116
Classify missing table on PG #2906
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@iamKunalGupta do unknown classifications get passed through as an error to slack without sending out notifications?
@@ -110,6 +108,9 @@ func (c *PostgresConnector) getRelIDForTable(ctx context.Context, schemaTable *u | |||
ON n.oid = c.relnamespace WHERE n.nspname=$1 AND c.relname=$2`, | |||
schemaTable.Schema, schemaTable.Table).Scan(&relID) | |||
if err != nil { | |||
if errors.Is(err, pgx.ErrNoRows) { | |||
return 0, shared.ErrTableDoesNotExist |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we want to include table name in the error information?
Also maybe we should wrap the original error as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
original error is already known to be pgx.ErrNoRows
, not sure if I'm following
Yes, anything unknown is auto sent to us, without sending out to customer |
If a Postgres table is dropped, then we get a
no rows in result set
error when a schema change (RelationMessage) is encountered.This PR catches this specific error case and classifies it