is <command>createlang</command> failing with unusual errors.
For example, running as the owner of the PostgreSQL installation:
<screen>
--bash-3.00$ createlang plpgsql template1
-createlang: language installation failed: ERROR: could not load library "/opt/dbs/pgsql748/lib/plpgsql.so": A memory address is not in the address space for the process.
+-bash-3.00$ createlang plperl template1
+createlang: language installation failed: ERROR: could not load library "/opt/dbs/pgsql748/lib/plperl.so": A memory address is not in the address space for the process.
</screen>
Running as a non-owner in the group posessing the PostgreSQL
installation:
<screen>
--bash-3.00$ createlang plpgsql template1
-createlang: language installation failed: ERROR: could not load library "/opt/dbs/pgsql748/lib/plpgsql.so": Bad address
+-bash-3.00$ createlang plperl template1
+createlang: language installation failed: ERROR: could not load library "/opt/dbs/pgsql748/lib/plperl.so": Bad address
</screen>
Another example is out of memory errors in the PostgreSQL server
logs, with every memory allocation near or greater than 256 MB
static void setup_privileges(void);
static void set_info_version(void);
static void setup_schema(void);
+static void load_plpgsql(void);
static void vacuum_db(void);
static void make_template0(void);
static void make_postgres(void);
check_ok();
}
+/*
+ * load PL/pgsql server-side language
+ */
+static void
+load_plpgsql(void)
+{
+ PG_CMD_DECL;
+
+ fputs(_("loading PL/pgSQL server-side language ... "), stdout);
+ fflush(stdout);
+
+ snprintf(cmd, sizeof(cmd),
+ "\"%s\" %s template1 >%s",
+ backend_exec, backend_options,
+ DEVNULL);
+
+ PG_CMD_OPEN;
+
+ PG_CMD_PUTS("CREATE LANGUAGE plpgsql;\n");
+
+ PG_CMD_CLOSE;
+
+ check_ok();
+}
+
/*
* clean everything up in template1
*/
setup_schema();
+ load_plpgsql();
+
vacuum_db();
make_template0();
#include "access/attnum.h"
#include "access/sysattr.h"
+#include "access/transam.h"
#include "catalog/pg_cast.h"
#include "catalog/pg_class.h"
#include "catalog/pg_default_acl.h"
"(%s lanowner) AS lanowner "
"FROM pg_language "
"WHERE lanispl "
+ /* do not dump initdb-installed languages */
+ "AND oid >= %u "
"ORDER BY oid",
- username_subquery);
+ username_subquery, FirstNormalObjectId);
}
else if (g_fout->remoteVersion >= 80300)
{
"lanvalidator, lanacl, "
"(%s lanowner) AS lanowner "
"FROM pg_language "
- "WHERE lanispl "
+ "WHERE lanispl%s"
"ORDER BY oid",
- username_subquery);
+ username_subquery,
+ binary_upgrade ? "\nAND lanname != 'plpgsql'" : "");
}
else if (g_fout->remoteVersion >= 80100)
{
## Run tests
##
-pg_regress_call = ./pg_regress --inputdir=$(srcdir) --dlpath=. --multibyte=$(MULTIBYTE) --load-language=plpgsql $(NOLOCALE)
+pg_regress_call = ./pg_regress --inputdir=$(srcdir) --dlpath=. --multibyte=$(MULTIBYTE) $(NOLOCALE)
check: all
$(pg_regress_call) --temp-install=./tmp_check --top-builddir=$(top_builddir) --schedule=$(srcdir)/parallel_schedule $(MAXCONNOPT) $(TEMP_CONF)