Hi,
When writing / debugging an isolation test it's sometimes useful to see which
session holds what lock etc. I find it kind of painful to map pg_stat_activity
/ pg_locks / log output to the isolationtester spec. Sometimes its easy enough
to infer identity based on a statement, but far from all the time.
I found it very helpful to have each session's setup step do something like
SET application_name = 'isolation/prune-recently-dead/vac';
These days isolationtester.c already prefixes log output with the session
name. How about doing the same for application_name? It's a *tad* more
complicated than I'd like because isolationtester.c currently doesn't know the
name of the test its executing.
The attached patch executes
SELECT set_config('application_name', current_setting('application_name') || '/' || $1, false);
when establishing connections to deal with that.
As attached this appends "control connection" for the control connection, but
perhaps we should just not append anything for that?
Greetings,
Andres Freund