On Fri, Feb 19, 2010 at 01:34:46PM -0500, Robert Haas wrote: > On Thu, Feb 18, 2010 at 11:38 PM, Tom Lane <t...@sss.pgh.pa.us> wrote: > > Takahiro Itagaki <itagaki.takah...@oss.ntt.co.jp> writes: > >> David Fetter <da...@fetter.org> wrote: > >>> support both pre-9.0 and post-9.0 PostgreSQLs. David Wheeler has > >>> suggested that we special-case PL/pgsql for 9.0 and greater, as it's > >>> in template0, where those tests are based. > > > >> +1 for the CREATE LANGUAGE IF NOT EXISTS behavior. > > > >> The regression test in the core is targeting only its version, > >> but some external projects have version-independent tests. > > > > I think it's more like "are under the fond illusion that their > > tests are version-independent". Are we going to back out the next > > incompatible change we choose to make as soon as somebody notices > > that it breaks a third-party test case? I don't think so. Let me > > point out that choosing to install plpgsql by default has already > > broken "--single" restore of practically every pg_dump out there. > > Nobody batted an eye about that. Why are we suddenly so > > concerned about its effects on unnamed test suites? > > I am still of the opinion that changing this was a bad idea for > exactly this reason. We could perhaps ameliorate this problem by > implementing CREATE OR REPLACE for languages and emitting that > instead; then the command in the dump would be a noop.
CREATE OR REPLACE LANGUAGE is an even bigger tar pit. For example: http://archives.postgresql.org/pgsql-hackers/2009-10/msg00386.php Please find attached a patch which does this check in pg_regress. Cheers, David. -- David Fetter <da...@fetter.org> http://fetter.org/ Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter Skype: davidfetter XMPP: david.fet...@gmail.com iCal: webcal://www.tripit.com/feed/ical/people/david74/tripit.ics Remember to vote! Consider donating to Postgres: http://www.postgresql.org/about/donate
diff --git a/src/test/regress/pg_regress.c b/src/test/regress/pg_regress.c index 991bb17..45aad00 100644 --- a/src/test/regress/pg_regress.c +++ b/src/test/regress/pg_regress.c @@ -1795,8 +1795,12 @@ create_database(const char *dbname) */ for (sl = loadlanguage; sl != NULL; sl = sl->next) { - header(_("installing %s"), sl->str); - psql_command(dbname, "CREATE LANGUAGE \"%s\"", sl->str); + if ((pg_strncasecmp(sl->str, "plpgsql", sizeof("plpgsql")) != 0) && + (pg_strncasecmp(sl->str, "pl/pgsql", sizeof("pl/pgsql")) != 0)) + { + header(_("installing %s"), sl->str); + psql_command(dbname, "CREATE LANGUAGE \"%s\"", sl->str); + } } }
-- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers