aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2010-02-24 01:35:14 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2010-02-24 01:35:14 +0000
commitb951c03f88129d2814dca5239f57653c8d6284d1 (patch)
tree492f52681b962e2ce932e53b514fb1d421b76adc /src
parent11b58470581f1c8cfad670c57ac3ffe77d1f0cdd (diff)
downloadpostgresql-b951c03f88129d2814dca5239f57653c8d6284d1.tar.gz
postgresql-b951c03f88129d2814dca5239f57653c8d6284d1.zip
Make pg_regress use CREATE OR REPLACE LANGUAGE, so that --load-language
will work whether or not the specified language is preinstalled. This responds to some complaints about having to change test scripts because plpgsql is preinstalled as of 9.0.
Diffstat (limited to 'src')
-rw-r--r--src/test/regress/pg_regress.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/test/regress/pg_regress.c b/src/test/regress/pg_regress.c
index 551b626d3c6..c91a09f960a 100644
--- a/src/test/regress/pg_regress.c
+++ b/src/test/regress/pg_regress.c
@@ -11,7 +11,7 @@
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/test/regress/pg_regress.c,v 1.69 2010/01/02 16:58:15 momjian Exp $
+ * $PostgreSQL: pgsql/src/test/regress/pg_regress.c,v 1.70 2010/02/24 01:35:14 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -1791,12 +1791,13 @@ create_database(const char *dbname)
dbname, dbname, dbname, dbname, dbname);
/*
- * Install any requested procedural languages
+ * Install any requested procedural languages. We use CREATE OR REPLACE
+ * so that this will work whether or not the language is preinstalled.
*/
for (sl = loadlanguage; sl != NULL; sl = sl->next)
{
header(_("installing %s"), sl->str);
- psql_command(dbname, "CREATE LANGUAGE \"%s\"", sl->str);
+ psql_command(dbname, "CREATE OR REPLACE LANGUAGE \"%s\"", sl->str);
}
}