You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
This patch implements putting language handlers for the optional PLs
into pg_catalog rather than public, and supports dumping languages whosehandlers are found there. This will make it easier to drop the publicschema if desired.Unlike the previous patch, the comments have been updated and I havereformatted some code to meet Alvarro's request to stick to 80 cols. (Iactually aghree with this - it makes printing the code much nicer).I think I did the right thing w.r.t versions earlier than 7.3, but Ihave no real way of checking, so that should be checked by someone withmore/older knowledge than me ;-)Andrew Dunstan
printfPQExpBuffer(&sql,"SELECT lanname as \"%s\", (CASE WHEN lanpltrusted THEN '%s' ELSE '%s' END) as \"%s\" FROM pg_language WHERE lanispl IS TRUE;",_("Name"),_("yes"),_("no"),_("Trusted?"));
143
+
printfPQExpBuffer(&sql,"SELECT lanname as \"%s\", (CASE WHEN lanpltrusted "
144
+
"THEN '%s' ELSE '%s' END) as \"%s\" FROM pg_language "
145
+
"WHERE lanispl IS TRUE;",
146
+
_("Name"),_("yes"),_("no"),_("Trusted?"));
144
147
result=executeQuery(conn,sql.data,progname,echo);
145
148
146
149
memset(&popt,0,sizeof(popt));
@@ -209,8 +212,10 @@ main(int argc, char *argv[])
209
212
}
210
213
else
211
214
{
212
-
fprintf(stderr,_("%s: unsupported language \"%s\"\n"),progname,langname);
213
-
fprintf(stderr,_("Supported languages are plpgsql, pltcl, pltclu, plperl, plperlu, and plpythonu.\n"));
215
+
fprintf(stderr,_("%s: unsupported language \"%s\"\n"),
216
+
progname,langname);
217
+
fprintf(stderr,_("Supported languages are plpgsql, pltcl, pltclu, "
printfPQExpBuffer(&sql,"SELECT oid FROM pg_language WHERE lanname = '%s';",langname);
227
+
printfPQExpBuffer(&sql,
228
+
"SELECT oid FROM pg_language WHERE lanname = '%s';",
229
+
langname);
223
230
result=executeQuery(conn,sql.data,progname,echo);
224
231
if (PQntuples(result)>0)
225
232
{
226
233
PQfinish(conn);
227
234
fprintf(stderr,
228
-
_("%s: language \"%s\" is already installed in database \"%s\"\n"),
235
+
_("%s: language \"%s\" is already installed in "
236
+
"database \"%s\"\n"),
229
237
progname,langname,dbname);
230
238
/* separate exit status for "already installed" */
231
239
exit(2);
@@ -235,7 +243,9 @@ main(int argc, char *argv[])
235
243
/*
236
244
* Check whether the call handler exists
237
245
*/
238
-
printfPQExpBuffer(&sql,"SELECT oid FROM pg_proc WHERE proname = '%s' AND prorettype = 'pg_catalog.language_handler'::regtype AND pronargs = 0;",handler);
246
+
printfPQExpBuffer(&sql,"SELECT oid FROM pg_proc WHERE proname = '%s' "