From: Andrew Gierth Date: Thu, 5 Apr 2018 03:05:40 +0000 (+0100) Subject: Install errcodes.txt for use by extensions. X-Git-Url: http://git.postgresql.org/gitweb/-?a=commitdiff_plain;h=1fd8690668635bab9dfa16b2885e6e474f8451ba;p=users%2Frhaas%2Fpostgres.git Install errcodes.txt for use by extensions. Maintainers of out-of-tree PLs typically need access to the set of error codes. To avoid the need to duplicate that information in some form in PL source trees, provide errcodes.txt as part of a server installation. Thomas Munro, based on a suggestion from Andrew Gierth Discussion: https://postgr.es/m/87woykk7mu.fsf%40news-spur.riddles.org.uk --- diff --git a/src/backend/Makefile b/src/backend/Makefile index 21b094385f..a4b6d1658c 100644 --- a/src/backend/Makefile +++ b/src/backend/Makefile @@ -247,6 +247,7 @@ endif endif $(MAKE) -C catalog install-data $(MAKE) -C tsearch install-data + $(MAKE) -C utils install-data $(INSTALL_DATA) $(srcdir)/libpq/pg_hba.conf.sample '$(DESTDIR)$(datadir)/pg_hba.conf.sample' $(INSTALL_DATA) $(srcdir)/libpq/pg_ident.conf.sample '$(DESTDIR)$(datadir)/pg_ident.conf.sample' $(INSTALL_DATA) $(srcdir)/utils/misc/postgresql.conf.sample '$(DESTDIR)$(datadir)/postgresql.conf.sample' @@ -312,6 +313,7 @@ endif endif $(MAKE) -C catalog uninstall-data $(MAKE) -C tsearch uninstall-data + $(MAKE) -C utils uninstall-data rm -f '$(DESTDIR)$(datadir)/pg_hba.conf.sample' \ '$(DESTDIR)$(datadir)/pg_ident.conf.sample' \ '$(DESTDIR)$(datadir)/postgresql.conf.sample' \ diff --git a/src/backend/utils/Makefile b/src/backend/utils/Makefile index e296e6ce4d..163c81a1c2 100644 --- a/src/backend/utils/Makefile +++ b/src/backend/utils/Makefile @@ -46,6 +46,16 @@ else sed -f $(srcdir)/Gen_dummy_probes.sed $< >$@ endif +.PHONY: install-data +install-data: errcodes.txt installdirs + $(INSTALL_DATA) $(srcdir)/errcodes.txt '$(DESTDIR)$(datadir)/errcodes.txt' + +installdirs: + $(MKDIR_P) '$(DESTDIR)$(datadir)' + +.PHONY: uninstall-data +uninstall-data: + rm -f $(addprefix '$(DESTDIR)$(datadir)'/, errcodes.txt) # fmgroids.h, fmgrprotos.h, fmgrtab.c and errcodes.h are in the # distribution tarball, so they are not cleaned here. diff --git a/src/tools/msvc/Install.pm b/src/tools/msvc/Install.pm index 33290993ad..82528eaa28 100644 --- a/src/tools/msvc/Install.pm +++ b/src/tools/msvc/Install.pm @@ -134,6 +134,9 @@ sub Install CopyFiles( 'Information schema data', $target . '/share/', 'src/backend/catalog/', 'sql_features.txt'); + CopyFiles( + 'Error code data', $target . '/share/', + 'src/backend/utils/', 'errcodes.txt'); GenerateConversionScript($target); GenerateTimezoneFiles($target, $conf); GenerateTsearchFiles($target);