Closed smurthys closed 6 years ago
Oh I understand the function now. I had mentioned in #235 that this function might be an issue, however I didn't realize that pg_stat_activity exposes backend_start. I will confirm that this function produces a matching session ID.
EDIT: On the surface this query seems to produce correct SessionIDs. If I have time in M3, I will try integrating it into the DDL trigger.
Adding SessionID
to DDLActivity
changes many functions and views, and needs many documentation changes. However, the changes are well defined and can be done in M3.
Also, making this change now prevents later API-compatibility issues. So, we should try to get this done in M3.
Adding column
SessionID
to tableDDLActivity
makes it possible to connect each DDL acitivity to an application and a connection. This information is necessary for analysis operations.Postgres doesn't have a function to get session id, but the following query (based on pg doc for
log_line_prefix
) should work: