Log the select version()
when connecting to the database
#3184
Labels
enhancement
a feature, ready for implementation
logging
messages
user-facing error/informative messages
Problem
Newcomers can connect to the wrong database when trying PostgREST. For example, on https://matrix.to/#/!YGChDzXeYxtlBZqVsc:gitter.im/$BZUIQtjG5xGvLKxaF_rtyp0cAKXq8ln2Rha66KtFtrc?via=gitter.im&via=matrix.org&via=matrix.freyachat.eu, the user created the API roles on a db and connected to other db (1):
There have been other cases where the user created tables on a db and connected to another one too; resulting in 404s when doing
curl /table
(2) and leading to thinking PostgREST has an outdated schema cache.Solution
Log the output of
select version()
when connecting to a db. For example, on PopOS this shows:This will show the OS so users will know they're connecting to their native pg or a dockerized one.
Would help with (2) but not with (1).
For (1) maybe we can fallback to connecting with the
postgres
role, die and log theversion()
?The text was updated successfully, but these errors were encountered: