Suppress testing the options of CREATE TEXT SEARCH DICTIONARY during
authorTom Lane <tgl@sss.pgh.pa.us>
Wed, 22 Aug 2007 22:30:20 +0000 (22:30 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 22 Aug 2007 22:30:20 +0000 (22:30 +0000)
initdb.  We should create all the standard dictionaries even though
some of them may not work in template1's encoding.  Per Teodor.

src/backend/commands/tsearchcmds.c

index 2a39e68c40e5526a8fa6b3034b26faafac39d044..d3c5f8f50702503fafa6fe6d0ec85a02fab78ae4 100644 (file)
@@ -418,6 +418,17 @@ verify_dictoptions(Oid tmplId, List *dictoptions)
        Form_pg_ts_template tform;
        Oid                     initmethod;
 
+       /*
+        * Suppress this test when running in a standalone backend.  This is a
+        * hack to allow initdb to create prefab dictionaries that might not
+        * actually be usable in template1's encoding (due to using external
+        * files that can't be translated into template1's encoding).  We want
+        * to create them anyway, since they might be usable later in other
+        * databases.
+        */
+       if (!IsUnderPostmaster)
+               return;
+
        tup = SearchSysCache(TSTEMPLATEOID,
                                                 ObjectIdGetDatum(tmplId),
                                                 0, 0, 0);