Added installation of created procedural languages to initdb
authorJan Wieck <[email protected]>
Wed, 12 May 1999 10:35:44 +0000 (10:35 +0000)
committerJan Wieck <[email protected]>
Wed, 12 May 1999 10:35:44 +0000 (10:35 +0000)
Jan

src/bin/initdb/Makefile
src/bin/initdb/initdb.sh
src/test/regress/sql/tests

index 6a2f58b766caf515268e65dc1b5aa3a76b549a17..a303cdb181187e10cd293990a8686c1a74130096 100644 (file)
@@ -17,7 +17,9 @@ include ../../Makefile.global
 all: initdb
 
 initdb: initdb.sh
-       sed 's/__MULTIBYTE__/$(MULTIBYTE)/' initdb.sh > initdb
+       sed -e 's/__MULTIBYTE__/$(MULTIBYTE)/'                  \
+               -e 's/__DLSUFFIX__/$(DLSUFFIX)/'                        \
+                       initdb.sh > initdb
 
 install: initdb
        $(INSTALL) $(INSTL_EXE_OPTS) $< $(BINDIR)/$<
index 640e6b9a425231481b1f2b51aa9d464975153a27..89693be6a1d2979bbf4dc29decd85974062c2e43 100644 (file)
@@ -491,6 +491,26 @@ echo "CREATE RULE \"_RETpg_indexes\" AS ON SELECT TO pg_indexes DO INSTEAD \
                   AND I.oid = X.indexrelid;" | \
        postgres $PGSQL_OPT template1 > /dev/null
 
+if [ -f $PGLIB/plpgsql__DLSUFFIX__ ] ; then
+       echo "Installing PL/pgSQL as trusted procedural language"
+       echo "CREATE FUNCTION plpgsql_call_handler () RETURNS opaque    \
+                       AS '$PGLIB/plpgsql__DLSUFFIX__' LANGUAGE 'C';" |                \
+               postgres $PGSQL_OPT template1 > /dev/null
+       echo "CREATE TRUSTED PROCEDURAL LANGUAGE 'plpgsql'                              \
+                       HANDLER plpgsql_call_handler LANCOMPILER 'PL/pgSQL';" | \
+               postgres $PGSQL_OPT template1 > /dev/null
+fi
+
+if [ -f $PGLIB/pltcl__DLSUFFIX__ ] ; then
+       echo "Installing PL/Tcl as trusted procedural language"
+       echo "CREATE FUNCTION pltcl_call_handler () RETURNS opaque              \
+                       AS '$PGLIB/pltcl__DLSUFFIX__' LANGUAGE 'C';" |          \
+               postgres $PGSQL_OPT template1 > /dev/null
+       echo "CREATE TRUSTED PROCEDURAL LANGUAGE 'pltcl'                                \
+                       HANDLER pltcl_call_handler LANCOMPILER 'PL/Tcl';" |     \
+               postgres $PGSQL_OPT template1 > /dev/null
+fi
+
 echo "Loading pg_description"
 echo "copy pg_description from '$TEMPLATE_DESCR'" | \
        postgres $PGSQL_OPT template1 > /dev/null
index 795cd11de4de26e9663d838fa2958c91c2c76532..5f965d535fc26a4e5993d2dd037077e3de8862de 100644 (file)
@@ -66,6 +66,5 @@ alter_table
 portals_p2
 rules
 limit
-install_plpgsql
 plpgsql
 temp