Roundup Tracker - Issues

Issue 2551299

Connecting to PostgreSQL database using pg_service.conf
Type: rfe Severity: normal
Components: Database Versions: 2.4.0
Status: pending remind
: rouilj : rouilj
Priority: normal :

Created on 2023-11-07 01:36 by rouilj, last changed 2023-11-07 17:18 by rouilj.

msg7857 Author: [hidden] (rouilj) Date: 2023-11-07 01:36
In the email chain starting with:

From: ivanov

On 2023-11-06 23:13, John P. Rouillard wrote: 
> Try this. Set the environment variable:
>   PGSERVICE=your_service_name
> Then remove any values for the settings:
>   host, port, user, password, and name
> in the rdbms section of the tracker's config.ini. (If you are not
> setting some of those values in your pg_service.conf, set them in
> config.ini.) Make sure the rdbms backend setting is set to postgresql.
> If your pg_service.conf file looks like:
> [roundup_roundup]
> host=
> port=5432
> user=rounduptest
> password=rounduptest
> dbname=rounduptest
> (the defaults for demo mode), run:
>   roundup-admin -i tracker_home list status
> and see if you get a connection error.

Excellent! Thank you very much. I will try it.

> psycopg2 looks like it can use a "service=service_name" in its connect
> method. (Working from

Django can use psycopg2/psycopg3 in a similar way. [...]
details can be found here:

> It might be a useful enhancement to support 'service' directly in
> config.ini. It would be useful when running one roundup server serving
> multiple trackers.
> If you want to move forward with Roundup and run multiple trackers
> with one Roundup server instance, we can work on getting support for
> specifying the 'service' in config.ini. You would need to test using
> the current development code.

Thank you. At the moment I plan to install only one tracker, but I think
it would be nice to have such an option. When you implement this, I will
be happy to test it.

Implementation thoughts.

Add [rdbms] service configuration setting to String
value. Default None/empty.

Modify to add 'service' to name tuple.

Because default service is None, no need to filter the setting out
in the connection_dict in or

Add doc to upgrading.txt on how to configure it.  Find out what
happens if password is set in config.ini and in pg_service.conf. Doc
same. I suspect that setting in config.ini will take priority.

I think that's it but we shall find out 8-).
msg7858 Author: [hidden] (rouilj) Date: 2023-11-07 17:18
Implemented in changeset:   7696:4af0d235b570. Took about 2 hours.

Note that error handling of bad parameters passed to psycopg2.connect
results in a psycopg2 traceback plus a roundup.hyperdb.DatabaseError
traceback from roundup-admin. Handling this better would be nice but
it's an admin tool so...
Date User Action Args
2023-11-07 17:18:29rouiljsetstatus: new -> pending
priority: normal
type: rfe
assignee: rouilj
components: + Database
versions: + 2.4.0
messages: + msg7858
resolution: remind
2023-11-07 01:36:17rouiljcreate