From 7438cf8a7cd5a43d1231b58bb356f9a4dc55e219 Mon Sep 17 00:00:00 2001 From: jvcalderon Date: Mon, 8 Jan 2024 17:01:37 +0100 Subject: [PATCH 1/3] Update account portal submodule --- packages/account-portal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/account-portal b/packages/account-portal index b11e6b4737..b23fb3b179 160000 --- a/packages/account-portal +++ b/packages/account-portal @@ -1 +1 @@ -Subproject commit b11e6b47370d9b77c63648b45929c86bfed6360c +Subproject commit b23fb3b17961fb04badd9487913a683fcf26dbe6 From fb720b564507588b99a966962c86f40e652275c5 Mon Sep 17 00:00:00 2001 From: jvcalderon Date: Mon, 8 Jan 2024 17:06:40 +0100 Subject: [PATCH 2/3] Upgrade account portal submodule --- packages/account-portal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/account-portal b/packages/account-portal index bcd86d9034..b23fb3b179 160000 --- a/packages/account-portal +++ b/packages/account-portal @@ -1 +1 @@ -Subproject commit bcd86d9034ba954f013da4c10171bf495ab88189 +Subproject commit b23fb3b17961fb04badd9487913a683fcf26dbe6 From 82ba1df4efdf7f96fcd8c4bdb4ca41f64d50cef5 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Tue, 9 Jan 2024 13:40:34 +0000 Subject: [PATCH 3/3] Fixing an issue with typing in the information_schema table that was leading to an 'invalid syntax name' message when attempting to fetch tables from our QA postgres database. --- packages/server/src/integrations/postgres.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/packages/server/src/integrations/postgres.ts b/packages/server/src/integrations/postgres.ts index ddc6e82f6d..78955c06dc 100644 --- a/packages/server/src/integrations/postgres.ts +++ b/packages/server/src/integrations/postgres.ts @@ -149,8 +149,6 @@ class PostgresIntegration extends Sql implements DatasourcePlus { private index: number = 1 private open: boolean - COLUMNS_SQL!: string - PRIMARY_KEYS_SQL = () => ` SELECT pg_namespace.nspname table_schema , pg_class.relname table_name @@ -171,6 +169,11 @@ class PostgresIntegration extends Sql implements DatasourcePlus { JOIN pg_catalog.pg_namespace n ON n.oid = t.typnamespace; ` + COLUMNS_SQL = () => ` + select * from information_schema.columns where table_schema = ANY(current_schemas(false)) + AND pg_table_is_visible(to_regclass(format('%I.%I', table_schema, table_name))); + ` + constructor(config: PostgresConfig) { super(SqlClient.POSTGRES) this.config = config @@ -224,8 +227,6 @@ class PostgresIntegration extends Sql implements DatasourcePlus { .split(",") .map(item => `"${item.trim()}"`) await this.client.query(`SET search_path TO ${search_path.join(",")};`) - this.COLUMNS_SQL = `select * from information_schema.columns where table_schema = ANY(current_schemas(false)) - AND pg_table_is_visible(to_regclass(table_schema || '.' || table_name));` this.open = true } @@ -312,7 +313,7 @@ class PostgresIntegration extends Sql implements DatasourcePlus { try { const columnsResponse: { rows: PostgresColumn[] } = - await this.client.query(this.COLUMNS_SQL) + await this.client.query(this.COLUMNS_SQL()) const tables: { [key: string]: Table } = {} @@ -382,7 +383,7 @@ class PostgresIntegration extends Sql implements DatasourcePlus { try { await this.openConnection() const columnsResponse: { rows: PostgresColumn[] } = - await this.client.query(this.COLUMNS_SQL) + await this.client.query(this.COLUMNS_SQL()) const names = columnsResponse.rows.map(row => row.table_name) return [...new Set(names)] } finally {