Re: define PG_REPLSLOT_DIR - Mailing list pgsql-hackers

From Ashutosh Bapat
Subject Re: define PG_REPLSLOT_DIR
Date
Msg-id CAExHW5vkjxuvyQ1fPPnuDW4nAT5jqox09ie36kciOV2+rhjbHA@mail.gmail.com
Whole thread Raw
In response to define PG_REPLSLOT_DIR  (Bertrand Drouvot <bertranddrouvot.pg@gmail.com>)
Responses Re: define PG_REPLSLOT_DIR
List pgsql-hackers
On Wed, Aug 14, 2024 at 5:02 PM Bertrand Drouvot
<bertranddrouvot.pg@gmail.com> wrote:
>
> Hi hackers,
>
> while working on a replication slot tool (idea is to put it in contrib, not
> shared yet), I realized that "pg_replslot" is being used > 25 times in
> .c files.
>
> I think it would make sense to replace those occurrences with a $SUBJECT, attached
> a patch doing so.

Many of these places are slot specific directory/file names within
pg_replslot. I think we can further improve the code by creating macro
on the lines of LSN_FORMAT_ARGS
#define SLOT_DIRNAME_ARGS(slotname) (PG_REPLSLOT_DIR, slotname)
this way we "codify" method to construct the slot directory name
everywhere. We may add another macro
#define SLOT_DIRNAME_FORMAT  "%s/%s" to further enforce the same. But
I didn't find similar LSN_FORMAT macro defined as "%X/%X". I don't
remember exactly why we didn't add it. May be because of trouble with
translations.

--
Best Wishes,
Ashutosh Bapat



pgsql-hackers by date:

Previous
From: Tomas Vondra
Date:
Subject: Re: Drop database command will raise "wrong tuple length" if pg_database tuple contains toast attribute.
Next
From: Ashutosh Bapat
Date:
Subject: Re: [PROPOSAL] : Disallow use of empty column name in (column_name '') in ALTER or CREATE of foreign table.