Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Has_Table does not work for PostgreSQL #18

Closed
stcarrez opened this issue May 14, 2023 · 0 comments
Closed

Has_Table does not work for PostgreSQL #18

stcarrez opened this issue May 14, 2023 · 0 comments

Comments

@stcarrez
Copy link
Owner

The ADO.Sessions.Has_Table function does not work for PostgreSQL.

The query looks in the information_schema and filters the TABLE_SCHEMA with the current database name.
This is not correct since, by default, the schema name is public, unless a specific configuration is made (see https://www.postgresqltutorial.com/postgresql-administration/postgresql-schema/).

Using SELECT to_regclass(:name) is more reliable.

@stcarrez stcarrez added the bug label May 14, 2023
stcarrez added a commit that referenced this issue May 14, 2023
Note: we don't prefix on the database name and the to_regclass() looks
only at the tables that are currently visible for the current PostgreSQL
connection (hence, associated with the current opened database)
@stcarrez stcarrez closed this as completed Jul 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant