Skip to content

Commit 1fd8690

Browse files
committed
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
1 parent a56e267 commit 1fd8690

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

src/backend/Makefile

+2
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,7 @@ endif
247247
endif
248248
$(MAKE) -C catalog install-data
249249
$(MAKE) -C tsearch install-data
250+
$(MAKE) -C utils install-data
250251
$(INSTALL_DATA) $(srcdir)/libpq/pg_hba.conf.sample '$(DESTDIR)$(datadir)/pg_hba.conf.sample'
251252
$(INSTALL_DATA) $(srcdir)/libpq/pg_ident.conf.sample '$(DESTDIR)$(datadir)/pg_ident.conf.sample'
252253
$(INSTALL_DATA) $(srcdir)/utils/misc/postgresql.conf.sample '$(DESTDIR)$(datadir)/postgresql.conf.sample'
@@ -312,6 +313,7 @@ endif
312313
endif
313314
$(MAKE) -C catalog uninstall-data
314315
$(MAKE) -C tsearch uninstall-data
316+
$(MAKE) -C utils uninstall-data
315317
rm -f '$(DESTDIR)$(datadir)/pg_hba.conf.sample' \
316318
'$(DESTDIR)$(datadir)/pg_ident.conf.sample' \
317319
'$(DESTDIR)$(datadir)/postgresql.conf.sample' \

src/backend/utils/Makefile

+10
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,16 @@ else
4646
sed -f $(srcdir)/Gen_dummy_probes.sed $< >$@
4747
endif
4848

49+
.PHONY: install-data
50+
install-data: errcodes.txt installdirs
51+
$(INSTALL_DATA) $(srcdir)/errcodes.txt '$(DESTDIR)$(datadir)/errcodes.txt'
52+
53+
installdirs:
54+
$(MKDIR_P) '$(DESTDIR)$(datadir)'
55+
56+
.PHONY: uninstall-data
57+
uninstall-data:
58+
rm -f $(addprefix '$(DESTDIR)$(datadir)'/, errcodes.txt)
4959

5060
# fmgroids.h, fmgrprotos.h, fmgrtab.c and errcodes.h are in the
5161
# distribution tarball, so they are not cleaned here.

src/tools/msvc/Install.pm

+3
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,9 @@ sub Install
134134
CopyFiles(
135135
'Information schema data', $target . '/share/',
136136
'src/backend/catalog/', 'sql_features.txt');
137+
CopyFiles(
138+
'Error code data', $target . '/share/',
139+
'src/backend/utils/', 'errcodes.txt');
137140
GenerateConversionScript($target);
138141
GenerateTimezoneFiles($target, $conf);
139142
GenerateTsearchFiles($target);

0 commit comments

Comments
 (0)