diff --git a/flow/connectors/postgres/client.go b/flow/connectors/postgres/client.go index 371510adbb..0b87e84078 100644 --- a/flow/connectors/postgres/client.go +++ b/flow/connectors/postgres/client.go @@ -624,7 +624,12 @@ func (c *PostgresConnector) CheckReplicationPermissions(username string) error { } if !replicationRes { - return fmt.Errorf("postgres user does not have replication role") + // RDS case: check pg_settings for rds.logical_replication + var setting string + err := c.pool.QueryRow(c.ctx, "SELECT setting FROM pg_settings WHERE name = 'rds.logical_replication';").Scan(&setting) + if err != nil || setting != "on" { + return fmt.Errorf("postgres user does not have replication role") + } } // check wal_level diff --git a/ui/app/mirrors/edit/[mirrorId]/cdcDetails.tsx b/ui/app/mirrors/edit/[mirrorId]/cdcDetails.tsx index 5a635eee1e..24f4c2ac38 100644 --- a/ui/app/mirrors/edit/[mirrorId]/cdcDetails.tsx +++ b/ui/app/mirrors/edit/[mirrorId]/cdcDetails.tsx @@ -17,7 +17,13 @@ type props = { createdAt?: Date; }; function CdcDetails({ syncs, createdAt, mirrorConfig }: props) { - let lastSyncedAt = moment(syncs[0]?.endTime).fromNow(); + let lastSyncedAt = moment( + syncs.length > 1 + ? syncs[1]?.endTime + : syncs.length + ? syncs[0]?.startTime + : new Date() + ).fromNow(); let rowsSynced = syncs.reduce((acc, sync) => { if (sync.endTime !== null) { return acc + sync.numRows;