Re: Normalize queries starting with SET for pg_stat_statements

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Greg Sabino Mullane <htamfids(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Normalize queries starting with SET for pg_stat_statements
Date: 2024-08-19 06:28:52
Message-ID: ZsLmJAoHvCLAhIXS@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Aug 13, 2024 at 10:54:34AM -0400, Greg Sabino Mullane wrote:
> Now that I've spent some time away from this, I'm reconsidering why we are
> going through all the trouble of semi-jumbling SET statements. Maybe we
> just keep it simple and everything becomes "SET myvar = $1" or even "SET
> myvar" full stop?

Showing a dollar-character to show the fact that we have a value
behind makes the post sense to me.

> I'm having a hard time finding a real-world situation in
> which we need to distinguish different SET/RESET items within
> pg_stat_statements.

I'm -1 on keeping the distinction, and AFAIK it's not really different
with the underlying problems that we need to solve for SET TRANSACTION
and the kind, no?

FWIW, I'm OK with hiding the value when it comes to a SET clause in a
CREATE FUNCTION. We already hide the contents of SQL queries inside
the SQL functions when these are queries that can be normalized, so
there is a kind of thin argument for consistency, or something close
to that.
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2024-08-19 06:29:06 Re: Thread-safe nl_langinfo() and localeconv()
Previous Message shveta malik 2024-08-19 06:23:50 Re: Conflict detection and logging in logical replication