Updating how we list columns from a table - to avoid using to_regclass which is not available in Postgres 9.5.

This commit is contained in:
mike12345567 2024-12-10 13:10:27 +00:00
parent a5f5f392f8
commit 4b75e3d1dc
1 changed files with 7 additions and 2 deletions

View File

@ -173,8 +173,13 @@ class PostgresIntegration extends Sql implements DatasourcePlus {
`
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)));
SELECT columns.*
FROM information_schema.columns columns
JOIN pg_class pg_class ON pg_class.relname = columns.table_name
JOIN pg_namespace name_space ON name_space.oid = pg_class.relnamespace
WHERE columns.table_schema = ANY(current_schemas(false))
AND columns.table_schema = name_space.nspname
AND pg_table_is_visible(pg_class.oid);
`
constructor(config: PostgresConfig) {