mirror of
https://github.com/postgres/postgres.git
synced 2025-08-25 20:23:07 +03:00
Convert createlang/droplang to use CREATE/DROP EXTENSION.
In createlang this is a one-line change. In droplang there's a whole lot of cruft that can be discarded since the extension mechanism now manages removal of the language's support functions. Also, add deprecation notices to these two programs' reference pages, since per discussion we may toss them overboard altogether in a release or two.
This commit is contained in:
@@ -188,7 +188,15 @@ main(int argc, char *argv[])
|
||||
}
|
||||
PQclear(result);
|
||||
|
||||
printfPQExpBuffer(&sql, "CREATE LANGUAGE \"%s\";\n", langname);
|
||||
/*
|
||||
* In 9.1 and up, assume that languages should be installed using CREATE
|
||||
* EXTENSION. However, it's possible this tool could be used against an
|
||||
* older server, and it's easy enough to continue supporting the old way.
|
||||
*/
|
||||
if (PQserverVersion(conn) >= 90100)
|
||||
printfPQExpBuffer(&sql, "CREATE EXTENSION \"%s\";\n", langname);
|
||||
else
|
||||
printfPQExpBuffer(&sql, "CREATE LANGUAGE \"%s\";\n", langname);
|
||||
|
||||
if (echo)
|
||||
printf("%s", sql.data);
|
||||
|
Reference in New Issue
Block a user