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

resolve unqualified names according to search_path #127

Open
ethanpailes opened this issue Oct 8, 2020 · 1 comment
Open

resolve unqualified names according to search_path #127

ethanpailes opened this issue Oct 8, 2020 · 1 comment
Labels
bug Something isn't working P-low

Comments

@ethanpailes
Copy link
Contributor

ethanpailes commented Oct 8, 2020

Right now unqualified table names are assumed to be in the public schema, but this is not quite right. There is nothing special about public except that it is a default value in the search_path. Databases can have other search paths configured, and therefore other default schemas. To correctly determine the schema of an unqualified name, I need to query the database.

This bug seems super uncommon though, so I'm going to mark it low priority.

See: https://www.postgresql.org/docs/13/runtime-config-client.html

@ethanpailes ethanpailes added bug Something isn't working P-low labels Oct 8, 2020
@ethanpailes
Copy link
Contributor Author

A note on how to perform the lookup from the ZomboDB maintainer:

you can do something like: SELECT * FROM pg_class WHERE oid = 'table_name'::regclass;
that'll resolve "table_name" to the first one on the search path and get you its row from pg_class
and if you know the schema, you can just WHERE oid = 'schema.table_name'::regclass;

Seems better than implementing the path resolution logic myself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P-low
Projects
None yet
Development

No branches or pull requests

1 participant