Re: query_id, pg_stat_activity, extended query protocol - Mailing list pgsql-hackers

From Alexander Lakhin
Subject Re: query_id, pg_stat_activity, extended query protocol
Date
Msg-id b37d8e6c-e83d-e157-8865-1b2460a6aef2@gmail.com
Whole thread Raw
In response to Re: query_id, pg_stat_activity, extended query protocol  (Sami Imseih <samimseih@gmail.com>)
List pgsql-hackers
Hello Michael,

02.10.2024 06:29, Michael Paquier wrote:
> On Wed, Oct 02, 2024 at 06:00:00AM +0300, Alexander Lakhin wrote:
>> Fortunately, it's still pretty warm here, so I'm wearing T-shirt and my
>> sleeve isn't long enough for that, but if you gave me 2-3 days, I would
>> focus on researching this area...
> Sure, thanks.  I am also spending a few days thinking about patterns
> around that before doing anything.  The buildfarm is green, so there
> is some flebxibility.

I've managed to falsify the Assert in ExecutorRun() with the following:
SET compute_query_id = 'off';
SET track_activities = 'off';

CREATE PROCEDURE p1()
LANGUAGE plpgsql
AS $$
BEGIN
     PERFORM 1;
END;
$$;

CREATE PROCEDURE p2(x int)
LANGUAGE plpgsql
AS $$
BEGIN
   IF x = 1 THEN
     SET track_activities = 'on';
     SET compute_query_id = 'on';
   END IF;
   CALL p1();
END;
$$;

CALL p2(0);

CALL p2(1);

TRAP: failed Assert("!IsQueryIdEnabled() || !pgstat_track_activities || !debug_query_string || pgstat_get_my_query_id()

!= 0"), File: "execMain.c", Line: 312, PID: 3765791

Best regards,
Alexander



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: allowing extensions to control planner behavior
Next
From: Robert Haas
Date:
Subject: Re: pg_basebackup and error messages dependent on the order of the arguments