From d4c2bbae64901d8c4513ff424d90c230a6fc3ea8 Mon Sep 17 00:00:00 2001 From: Kevin Biju Date: Mon, 22 Jan 2024 21:10:17 +0530 Subject: [PATCH] don't make getPkeyCols error out --- flow/connectors/postgres/client.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/flow/connectors/postgres/client.go b/flow/connectors/postgres/client.go index bf5bb98c46..cd0dd52de6 100644 --- a/flow/connectors/postgres/client.go +++ b/flow/connectors/postgres/client.go @@ -146,6 +146,10 @@ func (c *PostgresConnector) getPrimaryKeyColumns( `SELECT indexrelid FROM pg_index WHERE indrelid = $1 AND indisprimary`, relID).Scan(&pkIndexOID) if err != nil { + // don't error out if no pkey columns, this would happen in EnsurePullability or UI. + if err == pgx.ErrNoRows { + return []string{}, nil + } return nil, fmt.Errorf("error finding primary key index for table %s: %w", schemaTable, err) }