pgsql: Move logging.h and logging.c from src/fe_utils/ to src/common/.

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

pgsql: Move logging.h and logging.c from src/fe_utils/ to src/common/.

Tom Lane-2
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@...

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/fc9a62af3f87f4bec1e8c904ea99ae50f3c881ef

Modified Files
--------------
src/bin/initdb/initdb.c                       |  2 +-
src/bin/pg_archivecleanup/Makefile            |  4 +---
src/bin/pg_archivecleanup/pg_archivecleanup.c |  2 +-
src/bin/pg_basebackup/pg_basebackup.c         |  2 +-
src/bin/pg_basebackup/pg_receivewal.c         |  2 +-
src/bin/pg_basebackup/pg_recvlogical.c        |  2 +-
src/bin/pg_basebackup/receivelog.c            |  2 +-
src/bin/pg_basebackup/streamutil.c            |  2 +-
src/bin/pg_checksums/Makefile                 |  4 +---
src/bin/pg_checksums/pg_checksums.c           |  2 +-
src/bin/pg_controldata/Makefile               |  4 +---
src/bin/pg_controldata/pg_controldata.c       |  2 +-
src/bin/pg_ctl/Makefile                       |  4 +---
src/bin/pg_ctl/pg_ctl.c                       |  2 +-
src/bin/pg_dump/common.c                      |  1 -
src/bin/pg_dump/pg_backup_archiver.c          |  1 -
src/bin/pg_dump/pg_backup_custom.c            |  2 +-
src/bin/pg_dump/pg_backup_db.c                |  4 ++--
src/bin/pg_dump/pg_backup_utils.h             |  2 +-
src/bin/pg_dump/pg_dump.c                     |  1 -
src/bin/pg_dump/pg_dump_sort.c                |  1 -
src/bin/pg_dump/pg_dumpall.c                  |  2 +-
src/bin/pg_dump/pg_restore.c                  |  2 --
src/bin/pg_resetwal/Makefile                  |  4 +---
src/bin/pg_resetwal/pg_resetwal.c             |  2 +-
src/bin/pg_rewind/Makefile                    |  4 ++--
src/bin/pg_rewind/datapagemap.c               |  2 +-
src/bin/pg_rewind/pg_rewind.h                 |  2 +-
src/bin/pg_test_fsync/Makefile                |  4 +---
src/bin/pg_test_fsync/pg_test_fsync.c         |  2 +-
src/bin/pg_upgrade/pg_upgrade.c               |  2 +-
src/bin/pg_waldump/Makefile                   |  3 +--
src/bin/pg_waldump/pg_waldump.c               |  2 +-
src/bin/pgbench/pgbench.c                     |  2 +-
src/bin/psql/command.c                        |  4 ++--
src/bin/psql/common.c                         |  8 ++++----
src/bin/psql/copy.c                           |  2 +-
src/bin/psql/crosstabview.c                   |  2 +-
src/bin/psql/describe.c                       |  7 ++++---
src/bin/psql/help.c                           |  6 +++---
src/bin/psql/input.c                          |  2 +-
src/bin/psql/large_obj.c                      |  2 +-
src/bin/psql/mainloop.c                       |  2 +-
src/bin/psql/psqlscanslash.l                  |  2 +-
src/bin/psql/startup.c                        |  5 +++--
src/bin/psql/variables.c                      |  2 +-
src/bin/scripts/clusterdb.c                   |  2 +-
src/bin/scripts/common.c                      |  2 +-
src/bin/scripts/createdb.c                    |  2 +-
src/bin/scripts/createuser.c                  |  2 +-
src/bin/scripts/dropdb.c                      |  2 +-
src/bin/scripts/dropuser.c                    |  2 +-
src/bin/scripts/pg_isready.c                  |  2 +-
src/bin/scripts/reindexdb.c                   |  2 +-
src/bin/scripts/vacuumdb.c                    |  2 +-
src/common/Makefile                           |  4 +++-
src/common/controldata_utils.c                |  2 +-
src/common/file_utils.c                       |  2 +-
src/{fe_utils => common}/logging.c            | 23 +++++++++++++++--------
src/common/pgfnames.c                         |  2 +-
src/common/restricted_token.c                 |  2 +-
src/common/rmtree.c                           |  2 +-
src/fe_utils/Makefile                         |  2 +-
src/fe_utils/psqlscan.l                       |  2 +-
src/include/{fe_utils => common}/logging.h    | 10 +++++-----
src/interfaces/ecpg/test/Makefile             |  2 --
src/nls-global.mk                             |  2 +-
src/test/isolation/Makefile                   |  3 +--
src/test/regress/GNUmakefile                  |  4 +---
src/test/regress/pg_regress.c                 |  2 +-
src/tools/msvc/Mkvcbuild.pm                   | 10 +++++-----
71 files changed, 102 insertions(+), 115 deletions(-)