=== Applying patches on top of PostgreSQL commit ID 55a780e9476a753354a6db887e92125c7886ca6d === /etc/rc.d/jail: WARNING: Per-jail configuration via jail_* variables is obsolete. Please consider migrating to /etc/jail.conf. Tue Jul 8 02:32:17 UTC 2025 On branch cf/3405 nothing to commit, working tree clean === using 'git am' to apply patch ./0006_add_pg_stat_session_view.patch === Applying: Adds pg_stat_session view to track statistics accumulated during lifetime of a session (client backend). Using index info to reconstruct a base tree... M doc/src/sgml/monitoring.sgml M src/backend/catalog/system_views.sql M src/backend/utils/activity/backend_status.c M src/backend/utils/adt/pgstatfuncs.c M src/include/catalog/pg_proc.dat M src/include/utils/backend_status.h M src/test/regress/expected/rules.out Falling back to patching base and 3-way merge... Auto-merging src/test/regress/expected/rules.out Auto-merging src/include/utils/backend_status.h CONFLICT (content): Merge conflict in src/include/utils/backend_status.h Auto-merging src/include/catalog/pg_proc.dat Auto-merging src/backend/utils/adt/pgstatfuncs.c Auto-merging src/backend/utils/activity/backend_status.c CONFLICT (content): Merge conflict in src/backend/utils/activity/backend_status.c Auto-merging src/backend/catalog/system_views.sql Auto-merging doc/src/sgml/monitoring.sgml error: Failed to merge in the changes. hint: Use 'git am --show-current-patch=diff' to see the failed patch Patch failed at 0001 Adds pg_stat_session view to track statistics accumulated during lifetime of a session (client backend). When you have resolved this problem, run "git am --continue". If you prefer to skip this patch, run "git am --skip" instead. To restore the original branch and stop patching, run "git am --abort". Unstaged changes after reset: M doc/src/sgml/monitoring.sgml M src/backend/catalog/system_views.sql M src/backend/utils/activity/backend_status.c M src/backend/utils/adt/pgstatfuncs.c M src/include/catalog/pg_proc.dat M src/include/utils/backend_status.h M src/test/regress/expected/rules.out M src/test/regress/expected/sysviews.out M src/test/regress/sql/sysviews.sql === using patch(1) to apply patch ./0006_add_pg_stat_session_view.patch === patching file doc/src/sgml/monitoring.sgml Hunk #1 succeeded at 419 (offset 5 lines). Hunk #2 succeeded at 4834 (offset 48 lines). Hunk #3 succeeded at 5449 (offset 54 lines). patching file src/backend/catalog/system_views.sql Hunk #1 succeeded at 903 (offset 8 lines). patching file src/backend/utils/activity/backend_status.c Hunk #1 succeeded at 472 with fuzz 2 (offset 155 lines). Hunk #2 succeeded at 578 (offset 67 lines). Hunk #3 succeeded at 607 with fuzz 2 (offset 68 lines). Hunk #4 succeeded at 630 (offset 68 lines). Hunk #5 succeeded at 697 (offset 71 lines). patching file src/backend/utils/adt/pgstatfuncs.c patching file src/include/catalog/pg_proc.dat Hunk #1 succeeded at 5647 (offset 63 lines). patching file src/include/utils/backend_status.h Hunk #1 succeeded at 82 (offset 1 line). Hunk #2 FAILED at 188. Hunk #3 succeeded at 256 (offset 4 lines). 1 out of 3 hunks FAILED -- saving rejects to file src/include/utils/backend_status.h.rej patching file src/test/regress/expected/rules.out Hunk #1 succeeded at 2135 (offset 21 lines). patching file src/test/regress/expected/sysviews.out patching file src/test/regress/sql/sysviews.sql Unstaged changes after reset: M doc/src/sgml/monitoring.sgml M src/backend/catalog/system_views.sql M src/backend/utils/activity/backend_status.c M src/backend/utils/adt/pgstatfuncs.c M src/include/catalog/pg_proc.dat M src/include/utils/backend_status.h M src/test/regress/expected/rules.out M src/test/regress/expected/sysviews.out M src/test/regress/sql/sysviews.sql Removing src/include/utils/backend_status.h.rej === using 'git apply' to apply patch ./0006_add_pg_stat_session_view.patch === Applied patch to 'doc/src/sgml/monitoring.sgml' cleanly. Applied patch to 'src/backend/catalog/system_views.sql' cleanly. Applied patch to 'src/backend/utils/activity/backend_status.c' with conflicts. Applied patch to 'src/backend/utils/adt/pgstatfuncs.c' cleanly. Applied patch to 'src/include/catalog/pg_proc.dat' cleanly. Applied patch to 'src/include/utils/backend_status.h' with conflicts. Applied patch to 'src/test/regress/expected/rules.out' cleanly. Applied patch to 'src/test/regress/expected/sysviews.out' cleanly. Applied patch to 'src/test/regress/sql/sysviews.sql' cleanly. U src/backend/utils/activity/backend_status.c U src/include/utils/backend_status.h diff --cc src/backend/utils/activity/backend_status.c index a290cc4c975,d0c66f6d934..00000000000 --- a/src/backend/utils/activity/backend_status.c +++ b/src/backend/utils/activity/backend_status.c @@@ -300,8 -315,17 +300,22 @@@ pgstat_bestart_initial(void lbeentry.st_activity_start_timestamp = 0; lbeentry.st_state_start_timestamp = 0; lbeentry.st_xact_start_timestamp = 0; ++<<<<<<< ours + lbeentry.st_databaseid = InvalidOid; + lbeentry.st_userid = InvalidOid; ++======= + lbeentry.st_databaseid = MyDatabaseId; + + MemSet(&lbeentry.st_session, 0, sizeof(lbeentry.st_session)); + + /* We have userid for client-backends, wal-sender and bgworker processes */ + if (lbeentry.st_backendType == B_BACKEND + || lbeentry.st_backendType == B_WAL_SENDER + || lbeentry.st_backendType == B_BG_WORKER) + lbeentry.st_userid = GetSessionUserId(); + else + lbeentry.st_userid = InvalidOid; ++>>>>>>> theirs /* * We may not have a MyProcPort (eg, if this is the autovacuum process). @@@ -599,9 -537,9 +616,10 @@@ pgstat_report_activity(BackendState sta beentry->st_activity_start_timestamp = 0; /* st_xact_start_timestamp and wait_event_info are also disabled */ beentry->st_xact_start_timestamp = 0; - beentry->st_query_id = UINT64CONST(0); + beentry->st_query_id = INT64CONST(0); + beentry->st_plan_id = INT64CONST(0); proc->wait_event_info = 0; + MemSet(&beentry->st_session, 0, sizeof(beentry->st_session)); PGSTAT_END_WRITE_ACTIVITY(beentry); } return; diff --cc src/include/utils/backend_status.h index 3016501ac05,a04c3581d66..00000000000 --- a/src/include/utils/backend_status.h +++ b/src/include/utils/backend_status.h @@@ -170,10 -187,10 +188,17 @@@ typedef struct PgBackendStatu int64 st_progress_param[PGSTAT_NUM_PROGRESS_PARAM]; /* query identifier, optionally computed using post_parse_analyze_hook */ ++<<<<<<< ours + int64 st_query_id; + + /* plan identifier, optionally computed using planner_hook */ + int64 st_plan_id; ++======= + uint64 st_query_id; + + /* Counters accumulated since the start of the session */ + PgBackendSessionStatus st_session; ++>>>>>>> theirs } PgBackendStatus;