Re: pg_stat_statements vs. SELECT FOR UPDATE

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: pg_stat_statements vs. SELECT FOR UPDATE
Date: 2019-01-20 00:31:58
Message-ID: 23804.1547944318@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk> writes:
> "Tom" == Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:
> Tom> +1 for not ignoring rowMarks, but this patch seems like a hack to
> Tom> me. Why didn't you just add RowMarkClause as one of the known
> Tom> alternative expression node types?

> Because it's not an expression and nothing anywhere else in the backend
> treats it as such?

Places such as outfuncs.c and copyfuncs.c don't draw a distinction,
and I don't see why pg_stat_statements should either. It would just
be one more place we'd have to fix if we ever allow RowMarkClause in
other places --- or, perhaps more realistically, if the structure of
Query.rowMarks becomes more complex than "flat list of RowMarkClauses".

The other places you mention generally have some specific semantic
knowledge about rowmarks, and would have to be touched anyway if any
changes like that happen. But the jumbling code in pg_stat_statements
has no knowledge of any of that, it's just interested in traversing
the tree. So I'd put it on the same semantic level as outfuncs.c.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2019-01-20 00:37:29 Re: Thread-unsafe coding in ecpg
Previous Message Michael Meskes 2019-01-20 00:23:07 Re: Thread-unsafe coding in ecpg