Append major version number and for libraries soname major version number
authorPeter Eisentraut <peter_e@gmx.net>
Thu, 11 Dec 2008 07:34:09 +0000 (07:34 +0000)
committerPeter Eisentraut <peter_e@gmx.net>
Thu, 11 Dec 2008 07:34:09 +0000 (07:34 +0000)
to the gettext domain name, to simplify parallel installations.

Also, rename set_text_domain() to pg_bindtextdomain(), because that is what
it does.

39 files changed:
configure
configure.in
doc/src/sgml/Makefile
src/Makefile.global.in
src/Makefile.shlib
src/backend/main/main.c
src/backend/utils/init/miscinit.c
src/bin/initdb/initdb.c
src/bin/pg_config/pg_config.c
src/bin/pg_controldata/pg_controldata.c
src/bin/pg_ctl/pg_ctl.c
src/bin/pg_dump/pg_dump.c
src/bin/pg_dump/pg_dumpall.c
src/bin/pg_dump/pg_restore.c
src/bin/pg_resetxlog/pg_resetxlog.c
src/bin/psql/startup.c
src/bin/scripts/clusterdb.c
src/bin/scripts/createdb.c
src/bin/scripts/createlang.c
src/bin/scripts/createuser.c
src/bin/scripts/dropdb.c
src/bin/scripts/droplang.c
src/bin/scripts/dropuser.c
src/bin/scripts/reindexdb.c
src/bin/scripts/vacuumdb.c
src/include/c.h
src/include/miscadmin.h
src/include/pg_config.h.in
src/interfaces/ecpg/ecpglib/misc.c
src/interfaces/ecpg/preproc/ecpg.c
src/interfaces/libpq/fe-misc.c
src/nls-global.mk
src/pl/plperl/plperl.c
src/pl/plpgsql/src/pl_handler.c
src/pl/plpgsql/src/plpgsql.h
src/pl/plpython/plpython.c
src/pl/tcl/pltcl.c
src/port/exec.c
src/test/regress/pg_regress.c

index d4fde181c14464dbf5ca9357b8c5c4a9880e4104..063a6de40e695a4262502ab976665cfa6916e318 100755 (executable)
--- a/configure
+++ b/configure
@@ -656,6 +656,7 @@ build_alias
 host_alias
 target_alias
 configure_args
+PG_MAJORVERSION
 build
 build_cpu
 build_vendor
@@ -1910,6 +1911,13 @@ cat >>confdefs.h <<_ACEOF
 #define PG_VERSION "$PACKAGE_VERSION"
 _ACEOF
 
+PG_MAJORVERSION=`expr "$PACKAGE_VERSION" : '\([0-9][0-9]*\.[0-9][0-9]*\)'`
+
+
+cat >>confdefs.h <<_ACEOF
+#define PG_MAJORVERSION "$PG_MAJORVERSION"
+_ACEOF
+
 
 # Make sure we can run config.sub.
 $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
@@ -27183,6 +27191,7 @@ build_alias!$build_alias$ac_delim
 host_alias!$host_alias$ac_delim
 target_alias!$target_alias$ac_delim
 configure_args!$configure_args$ac_delim
+PG_MAJORVERSION!$PG_MAJORVERSION$ac_delim
 build!$build$ac_delim
 build_cpu!$build_cpu$ac_delim
 build_vendor!$build_vendor$ac_delim
@@ -27241,7 +27250,6 @@ EGREP!$EGREP$ac_delim
 ELF_SYS!$ELF_SYS$ac_delim
 LDFLAGS_SL!$LDFLAGS_SL$ac_delim
 LD!$LD$ac_delim
-with_gnu_ld!$with_gnu_ld$ac_delim
 _ACEOF
 
   if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
@@ -27283,6 +27291,7 @@ _ACEOF
 ac_delim='%!_!# '
 for ac_last_try in false false false false false :; do
   cat >conf$$subs.sed <<_ACEOF
+with_gnu_ld!$with_gnu_ld$ac_delim
 ld_R_works!$ld_R_works$ac_delim
 RANLIB!$RANLIB$ac_delim
 STRIP!$STRIP$ac_delim
@@ -27343,7 +27352,7 @@ vpath_build!$vpath_build$ac_delim
 LTLIBOBJS!$LTLIBOBJS$ac_delim
 _ACEOF
 
-  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 58; then
+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 59; then
     break
   elif $ac_last_try; then
     { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
index 0ed12b040f1f76a8d2fe3b68769a75871ada27c1..427c84df4dbb54768fb167db98f13587e429b984 100644 (file)
@@ -30,6 +30,9 @@ AC_PREFIX_DEFAULT(/usr/local/pgsql)
 AC_SUBST(configure_args, [$ac_configure_args])
 
 AC_DEFINE_UNQUOTED(PG_VERSION, "$PACKAGE_VERSION", [PostgreSQL version as a string])
+[PG_MAJORVERSION=`expr "$PACKAGE_VERSION" : '\([0-9][0-9]*\.[0-9][0-9]*\)'`]
+AC_SUBST(PG_MAJORVERSION)
+AC_DEFINE_UNQUOTED(PG_MAJORVERSION, "$PG_MAJORVERSION", [PostgreSQL major version as a string])
 
 AC_CANONICAL_HOST
 
index 1edcdfd3f2ce6a0ad0b54bddb714f8b93056534e..f6447c835166d320005c70ac0d979fa97a3f7295 100644 (file)
@@ -126,7 +126,7 @@ HTML.index:
 version.sgml: $(top_builddir)/src/Makefile.global
        { \
          echo "<!entity version \"$(VERSION)\">"; \
-         echo "<!entity majorversion \"`expr $(VERSION) : '\([0-9][0-9]*\.[0-9][0-9]*\)'`\">"; \
+         echo "<!entity majorversion \"$(MAJORVERSION)\">"; \
        } >$@
 
 features-supported.sgml: $(top_srcdir)/src/backend/catalog/sql_feature_packages.txt $(top_srcdir)/src/backend/catalog/sql_features.txt
index 63e422f126b248fc8b7b7f6e6ec4575acb5abf27..3202263daaf8083550b90defe44ce6fb61aae5ad 100644 (file)
@@ -30,6 +30,7 @@ all:
 
 # PostgreSQL version number
 VERSION = @PACKAGE_VERSION@
+MAJORVERSION = @PG_MAJORVERSION@
 
 # Support for VPATH builds
 vpath_build = @vpath_build@
index 9c615da2901143f02951ce9dff3492b5bc9e3f78..6aeaab4ddd67d426acb3f7276651894a76c11e91 100644 (file)
@@ -115,6 +115,10 @@ endif
 # Try to keep the sections in some kind of order, folks...
 
 override CFLAGS += $(CFLAGS_SL)
+ifdef SO_MAJOR_VERSION
+# libraries ought to use this to refer to versioned gettext domain names
+override CPPFLAGS += -DSO_MAJOR_VERSION=$(SO_MAJOR_VERSION)
+endif
 
 ifeq ($(PORTNAME), aix)
   ifdef SO_MAJOR_VERSION
index af7914a4687911300653d918709c0b00e1ce3308..f5cff431fba955456c8904d1d9016c44df807640 100644 (file)
@@ -87,7 +87,7 @@ main(int argc, char *argv[])
         * error messages to be localized.
         */
 
-       set_pglocale_pgservice(argv[0], "postgres");
+       set_pglocale_pgservice(argv[0], PG_TEXTDOMAIN("postgres"));
 
 #ifdef WIN32
 
index 596c288850fd4ec06e2ba5be801f13d610737c45..d3cbbf0890abb29522d3834a81fc07934b1da42a 100644 (file)
@@ -1214,7 +1214,7 @@ process_local_preload_libraries(void)
 }
 
 void
-set_text_domain(const char *domain)
+pg_bindtextdomain(const char *domain)
 {
 #ifdef ENABLE_NLS
        if (my_exec_path[0] != '\0')
index 5760b40f381180bd847498bce81e7f08e564644e..b8eda08755cf122a7e3b8e6e50d1ea65614de3c1 100644 (file)
@@ -2511,7 +2511,7 @@ main(int argc, char *argv[])
        };
 
        progname = get_progname(argv[0]);
-       set_pglocale_pgservice(argv[0], "initdb");
+       set_pglocale_pgservice(argv[0], PG_TEXTDOMAIN("initdb"));
 
        if (argc > 1)
        {
index d9807308ac1b2db91ac946b602e61bc880b7456f..bbee1b33135c01f1524586f8e67a8d361be48286 100644 (file)
@@ -465,7 +465,7 @@ main(int argc, char **argv)
        int                     j;
        int                     ret;
 
-       set_pglocale_pgservice(argv[0], "pg_config");
+       set_pglocale_pgservice(argv[0], PG_TEXTDOMAIN("pg_config"));
 
        progname = get_progname(argv[0]);
 
index bdbedfd99e6c0fcb6b1a0518e2b2dc58a9fa96d4..4ea849d7f1fec5c7b4a8d53f8f18e4f050f0231f 100644 (file)
@@ -76,7 +76,7 @@ main(int argc, char *argv[])
        const char *strftime_fmt = "%c";
        const char *progname;
 
-       set_pglocale_pgservice(argv[0], "pg_controldata");
+       set_pglocale_pgservice(argv[0], PG_TEXTDOMAIN("pg_controldata"));
 
        progname = get_progname(argv[0]);
 
index bc756959d24a76886e759c6ff12c90d7625934eb..a94faef728aa98ee5a1bbac1a6393d8a68f92d64 100644 (file)
@@ -1648,7 +1648,7 @@ main(int argc, char **argv)
 #endif
 
        progname = get_progname(argv[0]);
-       set_pglocale_pgservice(argv[0], "pg_ctl");
+       set_pglocale_pgservice(argv[0], PG_TEXTDOMAIN("pg_ctl"));
 
        /*
         * save argv[0] so do_start() can look for the postmaster if necessary. we
index a62b1eafc395852df4f3a7f1f455c90b413d8606..8d812b9b1f3437379562ab5b47a2c845cbc63e95 100644 (file)
@@ -274,7 +274,7 @@ main(int argc, char **argv)
                {NULL, 0, NULL, 0}
        };
 
-       set_pglocale_pgservice(argv[0], "pg_dump");
+       set_pglocale_pgservice(argv[0], PG_TEXTDOMAIN("pg_dump"));
 
        g_verbose = false;
 
index 8328af191153c0c2646f5730ee2e8b6b6be00f66..647cc7c9bd58a485cc64d91120a68503b7ff49e6 100644 (file)
@@ -127,7 +127,7 @@ main(int argc, char *argv[])
 
        int                     optindex;
 
-       set_pglocale_pgservice(argv[0], "pg_dump");
+       set_pglocale_pgservice(argv[0], PG_TEXTDOMAIN("pg_dump"));
 
        progname = get_progname(argv[0]);
 
index 899a8a4e4fa4506f7ec74faa44043146e81d8fe3..eb16aa9d4400b65424e1398c371fe326465a0ca6 100644 (file)
@@ -119,7 +119,7 @@ main(int argc, char **argv)
                {NULL, 0, NULL, 0}
        };
 
-       set_pglocale_pgservice(argv[0], "pg_dump");
+       set_pglocale_pgservice(argv[0], PG_TEXTDOMAIN("pg_dump"));
 
        opts = NewRestoreOptions();
 
index f495fe8fc47e6b343c979025937e148b37a312c8..bb61d08fb35bc8e453fcd46e9ffa412985356415 100644 (file)
@@ -96,7 +96,7 @@ main(int argc, char *argv[])
        int                     fd;
        char            path[MAXPGPATH];
 
-       set_pglocale_pgservice(argv[0], "pg_resetxlog");
+       set_pglocale_pgservice(argv[0], PG_TEXTDOMAIN("pg_resetxlog"));
 
        progname = get_progname(argv[0]);
 
index fdf65a55fc21971dd1919caac6b35a2ed47fa79c..e5b13f62c6e6d0b28f21fd4b5b5ec6414f030c8f 100644 (file)
@@ -96,7 +96,7 @@ main(int argc, char *argv[])
        char       *password_prompt = NULL;
        bool            new_pass;
 
-       set_pglocale_pgservice(argv[0], "psql");
+       set_pglocale_pgservice(argv[0], PG_TEXTDOMAIN("psql"));
 
        if (argc > 1)
        {
index 052a961d3e7ea53731bc5830c0267857c136a1fc..8b070a601b16347fc2d4425f37a83f9927a75461 100644 (file)
@@ -58,7 +58,7 @@ main(int argc, char *argv[])
        bool            verbose = false;
 
        progname = get_progname(argv[0]);
-       set_pglocale_pgservice(argv[0], "pgscripts");
+       set_pglocale_pgservice(argv[0], PG_TEXTDOMAIN("pgscripts"));
 
        handle_help_version_opts(argc, argv, "clusterdb", help);
 
index 369f87a611f60d619951daa3ac10aa969399eff6..e9e724a34a3e6776cbc46306fb0e56213a6ea7ef 100644 (file)
@@ -63,7 +63,7 @@ main(int argc, char *argv[])
        PGresult   *result;
 
        progname = get_progname(argv[0]);
-       set_pglocale_pgservice(argv[0], "pgscripts");
+       set_pglocale_pgservice(argv[0], PG_TEXTDOMAIN("pgscripts"));
 
        handle_help_version_opts(argc, argv, "createdb", help);
 
index 4ff35f01e4590730682d3640dda69c77999f6838..c4aaab2636129ee67cecb89746b9ecb7f9c658d0 100644 (file)
@@ -52,7 +52,7 @@ main(int argc, char *argv[])
        PGresult   *result;
 
        progname = get_progname(argv[0]);
-       set_pglocale_pgservice(argv[0], "pgscripts");
+       set_pglocale_pgservice(argv[0], PG_TEXTDOMAIN("pgscripts"));
 
        handle_help_version_opts(argc, argv, "createlang", help);
 
index 75cc41d06c19547d4cd9cbbe09bed39d871a9497..35e71496c4704575a7d2c9b18fde3cdad6f4dea5 100644 (file)
@@ -81,7 +81,7 @@ main(int argc, char *argv[])
        PGresult   *result;
 
        progname = get_progname(argv[0]);
-       set_pglocale_pgservice(argv[0], "pgscripts");
+       set_pglocale_pgservice(argv[0], PG_TEXTDOMAIN("pgscripts"));
 
        handle_help_version_opts(argc, argv, "createuser", help);
 
index 43c528e28e805c351cd925f9fbcd76e8d6db2894..0efda791dcec2a5c90604e6d471d646eddd2a7f2 100644 (file)
@@ -50,7 +50,7 @@ main(int argc, char *argv[])
        PGresult   *result;
 
        progname = get_progname(argv[0]);
-       set_pglocale_pgservice(argv[0], "pgscripts");
+       set_pglocale_pgservice(argv[0], PG_TEXTDOMAIN("pgscripts"));
 
        handle_help_version_opts(argc, argv, "dropdb", help);
 
index b226609425955dc7b78a3abf6f8ad2bfa787c087..c8acbe2da69c11a9230eb1b95ee24c51de777406 100644 (file)
@@ -63,7 +63,7 @@ main(int argc, char *argv[])
        PGresult   *result;
 
        progname = get_progname(argv[0]);
-       set_pglocale_pgservice(argv[0], "pgscripts");
+       set_pglocale_pgservice(argv[0], PG_TEXTDOMAIN("pgscripts"));
 
        handle_help_version_opts(argc, argv, "droplang", help);
 
index f4ceb56830825c9a899da0baacc1eb64cc4ee7e9..94ebd04fa8d93d40d2e136589e8309c1be2271f8 100644 (file)
@@ -50,7 +50,7 @@ main(int argc, char *argv[])
        PGresult   *result;
 
        progname = get_progname(argv[0]);
-       set_pglocale_pgservice(argv[0], "pgscripts");
+       set_pglocale_pgservice(argv[0], PG_TEXTDOMAIN("pgscripts"));
 
        handle_help_version_opts(argc, argv, "dropuser", help);
 
index afb06be44603c016ce8559bf3d767d717dea0d78..d0adb1677e4e62df802c65a2c3285e913416bac7 100644 (file)
@@ -64,7 +64,7 @@ main(int argc, char *argv[])
        const char *index = NULL;
 
        progname = get_progname(argv[0]);
-       set_pglocale_pgservice(argv[0], "pgscripts");
+       set_pglocale_pgservice(argv[0], PG_TEXTDOMAIN("pgscripts"));
 
        handle_help_version_opts(argc, argv, "reindexdb", help);
 
index 3f429d42575eb4a70a1c2325aaa49964119e2eb0..74690863619a52d079d677aaf1e808b7f535995e 100644 (file)
@@ -64,7 +64,7 @@ main(int argc, char *argv[])
        bool            verbose = false;
 
        progname = get_progname(argv[0]);
-       set_pglocale_pgservice(argv[0], "pgscripts");
+       set_pglocale_pgservice(argv[0], PG_TEXTDOMAIN("pgscripts"));
 
        handle_help_version_opts(argc, argv, "vacuumdb", help);
 
index d2dcaa783f5850c412eadfb264b9403f87615f35..cea61808f736b0dbfe0d60695853e39ab5f8e271 100644 (file)
@@ -715,6 +715,32 @@ typedef NameData *Name;
 #define STATUS_WAITING                 (2)
 
 
+/* gettext domain name mangling */
+
+/*
+ * To better support parallel installations of major PostgeSQL
+ * versions as well as parallel installations of major library soname
+ * versions, we mangle the gettext domain name by appending those
+ * version numbers.  The coding rule ought to be that whereever the
+ * domain name is mentioned as a literal, it must be wrapped into
+ * PG_TEXTDOMAIN().  The macros below do not work on non-literals; but
+ * that is somewhat intentional because it avoids having to worry
+ * about multiple states of premangling and postmangling as the values
+ * are being passed around.
+ *
+ * Make sure this matches the installation rules in nls-global.mk.
+ */
+
+/* need a second indirection because we want to stringize the macro value, not the name */
+#define CppAsString2(x) CppAsString(x)
+
+#ifdef SO_MAJOR_VERSION
+# define PG_TEXTDOMAIN(domain) (domain CppAsString2(SO_MAJOR_VERSION) "-" PG_MAJORVERSION)
+#else
+# define PG_TEXTDOMAIN(domain) (domain "-" PG_MAJORVERSION)
+#endif
+
+
 /* ----------------------------------------------------------------
  *                             Section 8: system-specific hacks
  *
index 86bd3988c5f802dee414eece94786835cbd1c34f..12e16b84d72b42abcf94ea669cfabd7ed37c1f03 100644 (file)
@@ -343,7 +343,7 @@ extern void RecordSharedMemoryInLockFile(unsigned long id1,
 extern void ValidatePgVersion(const char *path);
 extern void process_shared_preload_libraries(void);
 extern void process_local_preload_libraries(void);
-extern void set_text_domain(const char *domain);
+extern void pg_bindtextdomain(const char *domain);
 
 /* in access/transam/xlog.c */
 extern bool BackupInProgress(void);
index 9f6f21bf817efedfcc7dec0db3c6437600ecf311..5ba3ca82604c3eef951dde801ef90a7e572cddf3 100644 (file)
    (--with-krb-srvnam=NAME) */
 #undef PG_KRB_SRVNAM
 
+/* PostgreSQL major version as a string */
+#undef PG_MAJORVERSION
+
 /* PostgreSQL version as a string */
 #undef PG_VERSION
 
index d48cb9e957337daa68e3664f562c162642b035db..718e91143971c7d339cca7615d9ffbf7baba5554 100644 (file)
@@ -474,7 +474,7 @@ ecpg_gettext(const char *msgid)
                ldir = getenv("PGLOCALEDIR");
                if (!ldir)
                        ldir = LOCALEDIR;
-               bindtextdomain("ecpg", ldir);
+               bindtextdomain(PG_TEXTDOMAIN("ecpg"), ldir);
 #ifdef WIN32
                SetLastError(save_errno);
 #else
@@ -482,7 +482,7 @@ ecpg_gettext(const char *msgid)
 #endif
        }
 
-       return dgettext("ecpg", msgid);
+       return dgettext(PG_TEXTDOMAIN("ecpg"), msgid);
 }
 
 #endif   /* ENABLE_NLS */
index 48cd087b5de1c91f08b10063d325fbba692081a6..c51afd265c022d67a7381a1f7b1543052ea7d5d6 100644 (file)
@@ -138,7 +138,7 @@ main(int argc, char *const argv[])
        char            my_exec_path[MAXPGPATH];
        char            include_path[MAXPGPATH];
 
-       set_pglocale_pgservice(argv[0], "ecpg");
+       set_pglocale_pgservice(argv[0], PG_TEXTDOMAIN("ecpg"));
 
        progname = get_progname(argv[0]);
 
index b21528f18e8e1333ff7f68f64166b95215b65afb..00e7f0a99ab3830f6e41497b1b1325664d28172f 100644 (file)
@@ -1166,7 +1166,7 @@ libpq_gettext(const char *msgid)
                ldir = getenv("PGLOCALEDIR");
                if (!ldir)
                        ldir = LOCALEDIR;
-               bindtextdomain("libpq", ldir);
+               bindtextdomain(PG_TEXTDOMAIN("libpq"), ldir);
 #ifdef WIN32
                SetLastError(save_errno);
 #else
@@ -1174,7 +1174,7 @@ libpq_gettext(const char *msgid)
 #endif
        }
 
-       return dgettext("libpq", msgid);
+       return dgettext(PG_TEXTDOMAIN("libpq"), msgid);
 }
 
 #endif   /* ENABLE_NLS */
index 952aaca14e015d7ba123b4cd1651bda1e6587a1e..9ca68151c668ab110d12140cfb6445b821284638 100644 (file)
@@ -62,10 +62,11 @@ else # not XGETTEXT
 endif # not XGETTEXT
 
 
+# catalog name extentions must match behavior of PG_TEXTDOMAIN() in c.h
 install-po: all-po installdirs-po
 ifneq (,$(LANGUAGES))
        for lang in $(LANGUAGES); do \
-         $(INSTALL_DATA) po/$$lang.mo '$(DESTDIR)$(localedir)'/$$lang/LC_MESSAGES/$(CATALOG_NAME).mo || exit 1; \
+         $(INSTALL_DATA) po/$$lang.mo '$(DESTDIR)$(localedir)'/$$lang/LC_MESSAGES/$(CATALOG_NAME)$(SO_MAJOR_VERSION)-$(MAJORVERSION).mo || exit 1; \
        done
 endif
 
@@ -73,7 +74,7 @@ installdirs-po:
        $(mkinstalldirs) $(foreach lang, $(LANGUAGES), '$(DESTDIR)$(localedir)'/$(lang)/LC_MESSAGES)
 
 uninstall-po:
-       rm -f $(foreach lang, $(LANGUAGES), '$(DESTDIR)$(localedir)'/$(lang)/LC_MESSAGES/$(CATALOG_NAME).mo)
+       rm -f $(foreach lang, $(LANGUAGES), '$(DESTDIR)$(localedir)'/$(lang)/LC_MESSAGES/$(CATALOG_NAME)$(SO_MAJOR_VERSION)-$(MAJORVERSION).mo)
 
 
 clean-po:
index 709524aca66ef409eaeba0455f055b30f432ebb8..20bd969aea2dff2607d324604238adf7b52cc8cc 100644 (file)
@@ -32,7 +32,7 @@
 
 /* define our text domain for translations */
 #undef TEXTDOMAIN
-#define TEXTDOMAIN "plperl"
+#define TEXTDOMAIN PG_TEXTDOMAIN("plperl")
 
 /* perl stuff */
 #include "plperl.h"
@@ -190,7 +190,7 @@ _PG_init(void)
        if (inited)
                return;
 
-       set_text_domain(TEXTDOMAIN);
+       pg_bindtextdomain(TEXTDOMAIN);
 
        DefineCustomBoolVariable("plperl.use_strict",
          gettext_noop("If true, will compile trusted and untrusted perl code in strict mode"),
index 23dfb8e393cac1a96b9f570ec8bbe916787f30ae..a4c71fade2b6f0634a23a8f97c11c93f0ead3b55 100644 (file)
@@ -42,7 +42,7 @@ _PG_init(void)
        if (inited)
                return;
 
-       set_text_domain(TEXTDOMAIN);
+       pg_bindtextdomain(TEXTDOMAIN);
 
        plpgsql_HashTableInit();
        RegisterXactCallback(plpgsql_xact_cb, NULL);
index 07b844019c697bfc04fac96a597aafa5067c355c..ad08aaa7b289aa04a0b6967174548f09893604d9 100644 (file)
@@ -30,7 +30,7 @@
 
 /* define our text domain for translations */
 #undef TEXTDOMAIN
-#define TEXTDOMAIN "plpgsql"
+#define TEXTDOMAIN PG_TEXTDOMAIN("plpgsql")
 
 /* ----------
  * Compiler's namestack item types
index 1565c41372fd66c9ea8303df4511c16dddd475a1..72ec523d5935cb5314207cb2c130912bc5740965 100644 (file)
@@ -66,7 +66,7 @@ typedef int Py_ssize_t;
 
 /* define our text domain for translations */
 #undef TEXTDOMAIN
-#define TEXTDOMAIN "plpython"
+#define TEXTDOMAIN PG_TEXTDOMAIN("plpython")
 
 #include <compile.h>
 #include <eval.h>
@@ -2750,7 +2750,7 @@ _PG_init(void)
        if (inited)
                return;
 
-       set_text_domain(TEXTDOMAIN);
+       pg_bindtextdomain(TEXTDOMAIN);
 
        Py_Initialize();
        PLy_init_interp();
index 9807297e5c51eab49db437d9ef7b692e6bcd9b7b..fc586539fe312fa43a6d729c3a99c3ebe71b9f49 100644 (file)
@@ -44,7 +44,7 @@
 
 /* define our text domain for translations */
 #undef TEXTDOMAIN
-#define TEXTDOMAIN "pltcl"
+#define TEXTDOMAIN PG_TEXTDOMAIN("pltcl")
 
 #if defined(UNICODE_CONVERSION) && HAVE_TCL_VERSION(8,1)
 
@@ -268,7 +268,7 @@ _PG_init(void)
        if (pltcl_pm_init_done)
                return;
 
-       set_text_domain(TEXTDOMAIN);
+       pg_bindtextdomain(TEXTDOMAIN);
 
 #ifdef WIN32
        /* Required on win32 to prevent error loading init.tcl */
index 3c15f49280ab5a64d3b78c6ee6945a4054b0be20..cf3839ccbb00bd85bae460d3422ef65389e156c8 100644 (file)
@@ -630,7 +630,7 @@ set_pglocale_pgservice(const char *argv0, const char *app)
                                                                                                                                 * PGLOCALEDIR */
 
        /* don't set LC_ALL in the backend */
-       if (strcmp(app, "postgres") != 0)
+       if (strcmp(app, PG_TEXTDOMAIN("postgres")) != 0)
                setlocale(LC_ALL, "");
 
        if (find_my_exec(argv0, my_exec_path) < 0)
index 2c1181d6e1beeff3383c3e3683078b2e983b2ccb..c7dd767008e0ab19ce339414dc838deeb94ae9fe 100644 (file)
@@ -1894,7 +1894,7 @@ regression_main(int argc, char *argv[], init_function ifunc, test_function tfunc
        };
 
        progname = get_progname(argv[0]);
-       set_pglocale_pgservice(argv[0], "pg_regress");
+       set_pglocale_pgservice(argv[0], PG_TEXTDOMAIN("pg_regress"));
 
 #ifndef HAVE_UNIX_SOCKETS
        /* no unix domain sockets available, so change default */