-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Labels
difficulty: beginnerPure Haskell taskPure Haskell taskenhancementa feature, ready for implementationa feature, ready for implementationminor
Description
It would be nice to obtain the version like this:
select distinct application_name from pg_stat_activity where application_name like '%postgrest%';
application_name
------------------
postgrest-10.1.2The fallback_application_name fits this use case exactly, we can set it and still allow users to override it with application_name.
To implement this, we'd have to add ?fallback_application_name=val to configDbUri here:
postgrest/src/PostgREST/AppState.hs
Line 100 in 09249f9
| SQL.acquire configDbPoolSize timeoutMilliseconds $ toUtf8 configDbUri |
Where val would be the current postgREST version.
The ? should be added conditionally. If the uri already contains ?, then add &fallback_application_name=val else add ?fallback_application_name=val.
This function could be used for testing:
CREATE FUNCTION test.get_version() RETURNS pg_stat_activity.application_name%TYPE
AS $$
select distinct application_name from pg_stat_activity where application_name like '%postgrest%';
$$ LANGUAGE sql;wolfgangwalther
Metadata
Metadata
Assignees
Labels
difficulty: beginnerPure Haskell taskPure Haskell taskenhancementa feature, ready for implementationa feature, ready for implementationminor