diff --git a/flow/connectors/postgres/validate.go b/flow/connectors/postgres/validate.go index 4928e7c6d5..8e715278d8 100644 --- a/flow/connectors/postgres/validate.go +++ b/flow/connectors/postgres/validate.go @@ -69,15 +69,22 @@ func (c *PostgresConnector) CheckReplicationPermissions(ctx context.Context, use var replicationRes bool err := c.conn.QueryRow(ctx, "SELECT rolreplication FROM pg_roles WHERE rolname = $1", username).Scan(&replicationRes) if err != nil { - return err + if err == pgx.ErrNoRows { + c.logger.Warn("No rows in pg_roles for user. Skipping rolereplication check", + "username", username) + } else { + return err + } } if !replicationRes { // RDS case: check pg_settings for rds.logical_replication var setting string err := c.conn.QueryRow(ctx, "SELECT setting FROM pg_settings WHERE name = 'rds.logical_replication'").Scan(&setting) - if err != nil || setting != "on" { - return errors.New("postgres user does not have replication role") + if err != pgx.ErrNoRows { + if err != nil || setting != "on" { + return errors.New("postgres user does not have replication role") + } } }