!/dev/shm/PostgreSQL\\.[[:digit:]]+$ f

@@if not defined PG_VERS
@@define PG_VERS (17)
@@endif
@@if not defined PG_PORTS
@@define PG_PORTS (5432)
@@endif
@@if not defined PG_CLUSTERS
@@define PG_CLUSTERS (main)
@@endif
@@define PG_MCL @@{PG_VERS}/@@{PG_CLUSTERS}
@@define RUNPG @@{RUN}/postgresql
@@define VLPG var/lib/postgresql

 /@@{RUNPG}$ d RecreatedDir
!/@@{RUNPG}/\\.s\\.PGSQL\\.@@{PG_PORTS}$ s
!/@@{RUNPG}/\\.s\\.PGSQL\\.@@{PG_PORTS}\\.lock$ f
 /@@{RUNPG}/@@{PG_VERS}-@@{PG_CLUSTERS}\\.pg_stat_tmp$ d RecreatedDir
 /@@{RUNPG}/@@{PG_VERS}-@@{PG_CLUSTERS}\\.pid$ f PidFile
!/@@{RUNPG}/@@{PG_VERS}-@@{PG_CLUSTERS}\\.pg_stat_tmp/(db_[[:digit:]]+|global)\\.stat$ f

 /@@{VLPG}/@@{PG_MCL}(/base(/(1|[[:digit:]]{5,6}))?)?$ d VarDir
!/@@{VLPG}/@@{PG_MCL}/base/[[:digit:]]{5,6}/[[:digit:]]{4,6}(_(fsm|vm))?$ f
 /@@{VLPG}/@@{PG_MCL}/(global|pg_(logical|subtrans|wal|xact))$ d VarDir
 /@@{VLPG}/@@{PG_MCL}/global/pg_control$ f VarFile
!/@@{VLPG}/@@{PG_MCL}/(base/[[:digit:]]+|global)/pg_internal\\.init$ f
 /@@{VLPG}/@@{PG_MCL}/postmaster\\.opts$ f VarFile
 /@@{VLPG}/@@{PG_MCL}/postmaster\\.pid$ f PidFile
 /@@{VLPG}/@@{PG_MCL}/pg_logical/replorigin_checkpoint$ f VarFile
 /@@{VLPG}/@@{PG_MCL}/pg_xact/00[0-4][[:xdigit:]]$ f VarFile+ANF
 /@@{VLPG}/@@{PG_MCL}/pg_multixact/offsets/0000$ f VarFile
!/@@{VLPG}/@@{PG_MCL}/pg_subtrans/[[:xdigit:]]{4}$ f
!/@@{VLPG}/@@{PG_MCL}/pg_wal/[[:xdigit:]]{24}$ f

@@define POSTGRES_LOGDIR var/log/postgresql
@@define POSTGRES_LOGFILES postgresql-@@{PG_VERS}-@@{PG_CLUSTERS}\\.log
/@@{POSTGRES_LOGDIR}$ d                                             LogDir
/@@{POSTGRES_LOGDIR}/@@{POSTGRES_LOGFILES}$ f                       VarFile
/@@{POSTGRES_LOGDIR}/@@{POSTGRES_LOGFILES}\\.1$ f                   RotLog+ANF
/@@{POSTGRES_LOGDIR}/@@{POSTGRES_LOGFILES}\\.2\\.@@{LOGEXT}$ f      CompSerLog
/@@{POSTGRES_LOGDIR}/@@{POSTGRES_LOGFILES}\\.[3456789]\\.@@{LOGEXT}$ f MidlSerLog
/@@{POSTGRES_LOGDIR}/@@{POSTGRES_LOGFILES}\\.10\\.@@{LOGEXT}$ f     LastSerLog

@@undef PG_VERS
@@undef PG_PORTS
@@undef PG_CLUSTERS
@@undef PG_MCL
@@undef RUNPG
@@undef VLPG
