Skip to content

[Bug] [metadata] PG数据库元数据获取schema失败 #1130

@boolean-dev

Description

@boolean-dev

Search before asking

  • I had searched in the issues and found no similar issues.

What happened

我使用的是 AWS 的 RDS PostgreSQL数据库,在获取数据表的元数据时,无法获取 schema,在查看日志和源码之后,发现获取 schema 的 sql存在问题:
image
image

建议改成如下的查询 schema SQL

此 SQL是从 Navicat 获取 PG的schema改造而来,应该说通用性更好一些:

SELECT nspname AS "schema_name" FROM pg_namespace WHERE nspname NOT LIKE 'pg_%' AND nspname != 'information_schema';

What you expected to happen

正常获取PG数据库的schema

How to reproduce

获取 AWS RDS PostgreSQL 的schema

Anything else

后续我会提交相应的PR

目前我已经在 AWS RDS Aurora PostgreSQL、AWS RDS PostgreSQL、PostgreSQL12、PostgreSQL13 上进行了测试,新的SQL都可以正常获取 schema

Version

dev

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

Labels

BugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions