Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h5C2a-0001lp-AG for pgsql-hackers@arkaria.postgresql.org; Sat, 16 Mar 2019 16:20:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1h5C2Z-0003O9-2d for pgsql-hackers@arkaria.postgresql.org; Sat, 16 Mar 2019 16:20:07 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h5C2Y-0003O2-Ns for pgsql-hackers@lists.postgresql.org; Sat, 16 Mar 2019 16:20:06 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h5C2W-0000Ht-1j for pgsql-hackers@lists.postgresql.org; Sat, 16 Mar 2019 16:20:05 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x2GGK2kj028192; Sat, 16 Mar 2019 12:20:02 -0400 From: Tom Lane To: Robert Haas cc: Yun Li , PostgreSQL Hackers Subject: Re: Feature improvement: can we add queryId for pg_catalog.pg_stat_activity view? In-reply-to: References: <21800.1552701008@sss.pgh.pa.us> Comments: In-reply-to Robert Haas message dated "Sat, 16 Mar 2019 10:32:16 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <28190.1552753201.1@sss.pgh.pa.us> Date: Sat, 16 Mar 2019 12:20:01 -0400 Message-ID: <28191.1552753201@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Robert Haas writes: > On Fri, Mar 15, 2019 at 9:50 PM Tom Lane wrote: >> pg_stat_statements has a notion of query ID, but that notion might be >> quite inappropriate for other usages, which is why it's an extension >> and not core. > Having written an extension that also wanted a query ID, I disagree > with this position. [ shrug... ] The fact remains that pg_stat_statements's definition is pretty lame. There's a lot of judgment calls in which query fields it chooses to examine or ignore, and there's been no attempt at all to make the ID PG-version-independent, and I rather doubt that it's platform-independent either. Nor will the IDs survive a dump/reload even on the same server, since object OIDs will likely change. These things are OK, or at least mostly tolerable, for pg_stat_statements' usage ... but I don't think it's a good idea to have the core code dictating that definition to all extensions. Right now, if you have an extension that needs some other query-ID definition, you can do it, you just can't run that extension alongside pg_stat_statements. But you'll be out of luck if the core code starts filling that field. I'd be happier about having the core code compute a query ID if we had a definition that was not so obviously slapped together. regards, tom lane