aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Gierth <rhodiumtoad@postgresql.org>2018-04-05 04:05:40 +0100
committerAndrew Gierth <rhodiumtoad@postgresql.org>2018-04-05 04:05:40 +0100
commit1fd8690668635bab9dfa16b2885e6e474f8451ba (patch)
tree405a5bbdba426ec78117ab6169e119fc70bd4833 /src
parenta56e26784d7f418015a5be471eb500614a2f24ee (diff)
downloadpostgresql-1fd8690668635bab9dfa16b2885e6e474f8451ba.tar.gz
postgresql-1fd8690668635bab9dfa16b2885e6e474f8451ba.zip
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
Diffstat (limited to 'src')
-rw-r--r--src/backend/Makefile2
-rw-r--r--src/backend/utils/Makefile10
-rw-r--r--src/tools/msvc/Install.pm3
3 files changed, 15 insertions, 0 deletions
diff --git a/src/backend/Makefile b/src/backend/Makefile
index 21b094385f6..a4b6d1658cc 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 e296e6ce4d5..163c81a1c22 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 33290993add..82528eaa283 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);