define PG_REPLSLOT_DIR - Mailing list pgsql-hackers

From Bertrand Drouvot
Subject define PG_REPLSLOT_DIR
Date
Msg-id ZryVvjqS9SnV1GPP@ip-10-97-1-34.eu-west-3.compute.internal
Whole thread Raw
List pgsql-hackers
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.

There is 2 places where it is not done:

src/bin/initdb/initdb.c
src/bin/pg_rewind/filemap.c

for consistency with the existing PG_STAT_TMP_DIR define.

Out of curiosity, checking the sizes of affected files (O2, no debug):

with patch:

   text    data     bss     dec     hex filename
  20315     224      17   20556    504c src/backend/backup/basebackup.o
  30304       0       8   30312    7668 src/backend/replication/logical/reorderbuffer.o
  23812      36      40   23888    5d50 src/backend/replication/slot.o
   6367       0       0    6367    18df src/backend/utils/adt/genfile.o
  40997    2574    2528   46099    b413 src/bin/initdb/initdb.o
   6963     224       8    7195    1c1b src/bin/pg_rewind/filemap.o

without patch:

   text    data     bss     dec     hex filename
  20315     224      17   20556    504c src/backend/backup/basebackup.o
  30286       0       8   30294    7656 src/backend/replication/logical/reorderbuffer.o
  23766      36      40   23842    5d22 src/backend/replication/slot.o
   6363       0       0    6363    18db src/backend/utils/adt/genfile.o
  40997    2574    2528   46099    b413 src/bin/initdb/initdb.o
   6963     224       8    7195    1c1b src/bin/pg_rewind/filemap.o

Also, I think we could do the same for:

pg_notify
pg_serial
pg_subtrans
pg_wal
pg_multixact
pg_tblspc
pg_logical

And I volunteer to do so if you think that makes sense.

Looking forward to your feedback,

Regards,

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

Attachment

pgsql-hackers by date:

Previous
From: Aleksander Alekseev
Date:
Subject: Re: [PATCH] Add get_bytes() and set_bytes() functions
Next
From: Thomas Munro
Date:
Subject: Re: Thread-safe nl_langinfo() and localeconv()