Re: Generate pg_stat_get_* functions with Macros

From: "Drouvot, Bertrand" <bertranddrouvot(dot)pg(at)gmail(dot)com>
To: Nathan Bossart <nathandbossart(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Generate pg_stat_get_* functions with Macros
Date: 2022-12-03 09:31:19
Message-ID: e5919fa9-c82d-a6e2-eb20-7f84d5b669d6@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 12/3/22 1:51 AM, Nathan Bossart wrote:
> Overall, this change looks straightforward, and it saves a couple hundred
> lines.
>

Thanks for looking at it!

> On Tue, Nov 22, 2022 at 08:09:22AM +0100, Drouvot, Bertrand wrote:
>> +/* pg_stat_get_numscans */
>> +PGSTAT_DEFINE_REL_INT64_FIELD_ACCESSOR(pg_stat_get_, numscans);
>> +
>> +/* pg_stat_get_tuples_returned */
>> +PGSTAT_DEFINE_REL_INT64_FIELD_ACCESSOR(pg_stat_get_, tuples_returned);
>> +
>> +/* pg_stat_get_tuples_fetched */
>> +PGSTAT_DEFINE_REL_INT64_FIELD_ACCESSOR(pg_stat_get_, tuples_fetched);
>
> Can we hard-code the prefix in the macro? It looks like all of these use
> the same one.
>

Good point! Done in V2 attached.

Regards,

--
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com

Attachment Content-Type Size
v2-0001-PGSTAT_DEFINE_REL_FIELD_ACCESSOR.patch text/plain 17.0 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2022-12-03 11:37:20 Re: Avoid streaming the transaction which are skipped (in corner cases)
Previous Message Nikolay Samokhvalov 2022-12-03 06:59:18 Re: Transaction timeout