]> granicus.if.org Git - postgresql/commit - src/bin/psql/common.c
Move logging.h and logging.c from src/fe_utils/ to src/common/.
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 14 May 2019 18:19:49 +0000 (14:19 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 14 May 2019 18:20:10 +0000 (14:20 -0400)
commitfc9a62af3f87f4bec1e8c904ea99ae50f3c881ef
treea566ea096bbebc18e307370917e061d49f725291
parentb71dad22ce8a645a47c01e544f640f35b91bfbd3
Move logging.h and logging.c from src/fe_utils/ to src/common/.

The original placement of this module in src/fe_utils/ is ill-considered,
because several src/common/ modules have dependencies on it, meaning that
libpgcommon and libpgfeutils now have mutual dependencies.  That makes it
pointless to have distinct libraries at all.  The intended design is that
libpgcommon is lower-level than libpgfeutils, so only dependencies from
the latter to the former are acceptable.

We already have the precedent that fe_memutils and a couple of other
modules in src/common/ are frontend-only, so it's not stretching anything
out of whack to treat logging.c as a frontend-only module in src/common/.
To the extent that such modules help provide a common frontend/backend
environment for the rest of common/ to use, it's a reasonable design.
(logging.c does not yet provide an ereport() emulation, but one can
dream.)

Hence, move these files over, and revert basically all of the build-system
changes made by commit cc8d41511.  There are no places that need to grow
new dependencies on libpgcommon, further reinforcing the idea that this
is the right solution.

Discussion: https://postgr.es/m/a912ffff-f6e4-778a-c86a-cf5c47a12933@2ndquadrant.com
71 files changed:
src/bin/initdb/initdb.c
src/bin/pg_archivecleanup/Makefile
src/bin/pg_archivecleanup/pg_archivecleanup.c
src/bin/pg_basebackup/pg_basebackup.c
src/bin/pg_basebackup/pg_receivewal.c
src/bin/pg_basebackup/pg_recvlogical.c
src/bin/pg_basebackup/receivelog.c
src/bin/pg_basebackup/streamutil.c
src/bin/pg_checksums/Makefile
src/bin/pg_checksums/pg_checksums.c
src/bin/pg_controldata/Makefile
src/bin/pg_controldata/pg_controldata.c
src/bin/pg_ctl/Makefile
src/bin/pg_ctl/pg_ctl.c
src/bin/pg_dump/common.c
src/bin/pg_dump/pg_backup_archiver.c
src/bin/pg_dump/pg_backup_custom.c
src/bin/pg_dump/pg_backup_db.c
src/bin/pg_dump/pg_backup_utils.h
src/bin/pg_dump/pg_dump.c
src/bin/pg_dump/pg_dump_sort.c
src/bin/pg_dump/pg_dumpall.c
src/bin/pg_dump/pg_restore.c
src/bin/pg_resetwal/Makefile
src/bin/pg_resetwal/pg_resetwal.c
src/bin/pg_rewind/Makefile
src/bin/pg_rewind/datapagemap.c
src/bin/pg_rewind/pg_rewind.h
src/bin/pg_test_fsync/Makefile
src/bin/pg_test_fsync/pg_test_fsync.c
src/bin/pg_upgrade/pg_upgrade.c
src/bin/pg_waldump/Makefile
src/bin/pg_waldump/pg_waldump.c
src/bin/pgbench/pgbench.c
src/bin/psql/command.c
src/bin/psql/common.c
src/bin/psql/copy.c
src/bin/psql/crosstabview.c
src/bin/psql/describe.c
src/bin/psql/help.c
src/bin/psql/input.c
src/bin/psql/large_obj.c
src/bin/psql/mainloop.c
src/bin/psql/psqlscanslash.l
src/bin/psql/startup.c
src/bin/psql/variables.c
src/bin/scripts/clusterdb.c
src/bin/scripts/common.c
src/bin/scripts/createdb.c
src/bin/scripts/createuser.c
src/bin/scripts/dropdb.c
src/bin/scripts/dropuser.c
src/bin/scripts/pg_isready.c
src/bin/scripts/reindexdb.c
src/bin/scripts/vacuumdb.c
src/common/Makefile
src/common/controldata_utils.c
src/common/file_utils.c
src/common/logging.c [moved from src/fe_utils/logging.c with 92% similarity]
src/common/pgfnames.c
src/common/restricted_token.c
src/common/rmtree.c
src/fe_utils/Makefile
src/fe_utils/psqlscan.l
src/include/common/logging.h [moved from src/include/fe_utils/logging.h with 92% similarity]
src/interfaces/ecpg/test/Makefile
src/nls-global.mk
src/test/isolation/Makefile
src/test/regress/GNUmakefile
src/test/regress/pg_regress.c
src/tools/msvc/Mkvcbuild.pm