Frontends including fd.h

Started by Michael Paquierabout 7 years ago2 messages
#1Michael Paquier
michael@paquier.xyz

Hi all,

We have a couple of frontend binaries (pg_rewind, and now
pg_verify_checksums) including directly fd.h to get the definitions of
PG_TEMP_FILES_DIR and PG_TEMP_FILE_PREFIX. This is a poor choice I
think, because fd.h is aimed at being used by the backend, and there
are some routines declared there which could conflict with their
frontend equivalents, like the various wrappers for fsync.

I have suggested a couple of months ago to have a specific header for
path-related variables, which I called src/include/pg_paths.h, but not
many people liked that. Perhaps it would be time to bite the bullet, I
think that we are on a path where problems are going to show up for
frontends. At least PG_TEMP_FILES_DIR and PG_TEMP_FILE_PREFIX could be
moved to it to remove all the existing problems.

Thoughts or opinions?
--
Michael

In reply to: Michael Paquier (#1)
Re: Frontends including fd.h

Hello

I am +1 to have separate header with path names.

Another examples are:
- pg_ctl with many hardcoded files such as "promote" (PROMOTE_SIGNAL_FILE), "logrotate" (LOGROTATE_SIGNAL_FILE), postgresql.conf, PG_VERSION, backup_label, postmaster.pid
- pg_basebackup with currently hardcoded "standby.signal" (STANDBY_SIGNAL_FILE) and "postgresql.auto.conf"

regards, Sergei