Commit d879697c authored by Tom Lane's avatar Tom Lane

Remove the default_do_language parameter, instead making DO use a hardwired

default of "plpgsql".  This is more reasonable than it was when the DO patch
was written, because we have since decided that plpgsql should be installed
by default.  Per discussion, having a parameter for this doesn't seem useful
enough to justify the risk of application breakage if the value is changed
unexpectedly.
parent 6c0f94fc
<!-- $PostgreSQL: pgsql/doc/src/sgml/config.sgml,v 1.245 2010/01/23 16:37:12 sriggs Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/config.sgml,v 1.246 2010/01/26 16:33:40 tgl Exp $ -->
<chapter Id="runtime-config"> <chapter Id="runtime-config">
<title>Server Configuration</title> <title>Server Configuration</title>
...@@ -4132,21 +4132,6 @@ COPY postgres_log FROM '/full/path/to/logfile.csv' WITH csv; ...@@ -4132,21 +4132,6 @@ COPY postgres_log FROM '/full/path/to/logfile.csv' WITH csv;
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry id="guc-default-do-language" xreflabel="default_do_language">
<term><varname>default_do_language</varname> (<type>string</type>)</term>
<indexterm>
<primary><varname>default_do_language</> configuration parameter</primary>
</indexterm>
<listitem>
<para>
This parameter specifies the language to use when the
<literal>LANGUAGE</> option is omitted in a
<xref linkend="sql-do" endterm="sql-do-title"> statement.
The default is <literal>plpgsql</literal>.
</para>
</listitem>
</varlistentry>
<varlistentry id="guc-default-transaction-isolation" xreflabel="default_transaction_isolation"> <varlistentry id="guc-default-transaction-isolation" xreflabel="default_transaction_isolation">
<indexterm> <indexterm>
<primary>transaction isolation level</primary> <primary>transaction isolation level</primary>
......
<!-- <!--
$PostgreSQL: pgsql/doc/src/sgml/ref/do.sgml,v 1.2 2009/09/23 15:41:51 tgl Exp $ $PostgreSQL: pgsql/doc/src/sgml/ref/do.sgml,v 1.3 2010/01/26 16:33:40 tgl Exp $
PostgreSQL documentation PostgreSQL documentation
--> -->
...@@ -69,8 +69,7 @@ DO <replaceable class="PARAMETER">code</replaceable> [ LANGUAGE <replaceable cla ...@@ -69,8 +69,7 @@ DO <replaceable class="PARAMETER">code</replaceable> [ LANGUAGE <replaceable cla
<listitem> <listitem>
<para> <para>
The name of the procedural language the code is written in. The name of the procedural language the code is written in.
If omitted, the default is determined by the runtime parameter If omitted, the default is <literal>plpgsql</>.
<xref linkend="guc-default-do-language">.
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
...@@ -83,6 +82,7 @@ DO <replaceable class="PARAMETER">code</replaceable> [ LANGUAGE <replaceable cla ...@@ -83,6 +82,7 @@ DO <replaceable class="PARAMETER">code</replaceable> [ LANGUAGE <replaceable cla
<para> <para>
The procedural language to be used must already have been installed The procedural language to be used must already have been installed
into the current database by means of <command>CREATE LANGUAGE</>. into the current database by means of <command>CREATE LANGUAGE</>.
<literal>plpgsql</> is installed by default, but other languages are not.
</para> </para>
<para> <para>
...@@ -108,8 +108,6 @@ BEGIN ...@@ -108,8 +108,6 @@ BEGIN
END LOOP; END LOOP;
END$$; END$$;
</programlisting> </programlisting>
This example assumes that <varname>default_do_language</> has its
default value, namely <literal>plpgsql</>.
</para> </para>
</refsect1> </refsect1>
<refsect1> <refsect1>
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/commands/functioncmds.c,v 1.114 2010/01/02 16:57:37 momjian Exp $ * $PostgreSQL: pgsql/src/backend/commands/functioncmds.c,v 1.115 2010/01/26 16:33:40 tgl Exp $
* *
* DESCRIPTION * DESCRIPTION
* These routines take the parse tree and pick out the * These routines take the parse tree and pick out the
...@@ -2001,11 +2001,11 @@ ExecuteDoStmt(DoStmt *stmt) ...@@ -2001,11 +2001,11 @@ ExecuteDoStmt(DoStmt *stmt)
(errcode(ERRCODE_SYNTAX_ERROR), (errcode(ERRCODE_SYNTAX_ERROR),
errmsg("no inline code specified"))); errmsg("no inline code specified")));
/* if LANGUAGE option wasn't specified, use the default language */ /* if LANGUAGE option wasn't specified, use the default */
if (language_item) if (language_item)
language = strVal(language_item->arg); language = strVal(language_item->arg);
else else
language = default_do_language; language = "plpgsql";
/* Convert language name to canonical case */ /* Convert language name to canonical case */
languageName = case_translate_language_name(language); languageName = case_translate_language_name(language);
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
* Written by Peter Eisentraut <peter_e@gmx.net>. * Written by Peter Eisentraut <peter_e@gmx.net>.
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.535 2010/01/24 21:49:17 tgl Exp $ * $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.536 2010/01/26 16:33:40 tgl Exp $
* *
*-------------------------------------------------------------------- *--------------------------------------------------------------------
*/ */
...@@ -383,8 +383,6 @@ char *external_pid_file; ...@@ -383,8 +383,6 @@ char *external_pid_file;
char *pgstat_temp_directory; char *pgstat_temp_directory;
char *default_do_language;
char *application_name; char *application_name;
int tcp_keepalives_idle; int tcp_keepalives_idle;
...@@ -2603,15 +2601,6 @@ static struct config_string ConfigureNamesString[] = ...@@ -2603,15 +2601,6 @@ static struct config_string ConfigureNamesString[] =
}, },
#endif /* USE_SSL */ #endif /* USE_SSL */
{
{"default_do_language", PGC_USERSET, CLIENT_CONN_STATEMENT,
gettext_noop("Sets the language used in DO statement if LANGUAGE is not specified."),
NULL
},
&default_do_language,
"plpgsql", NULL, NULL
},
{ {
{"application_name", PGC_USERSET, LOGGING, {"application_name", PGC_USERSET, LOGGING,
gettext_noop("Sets the application name to be reported in statistics and logs."), gettext_noop("Sets the application name to be reported in statistics and logs."),
......
...@@ -432,7 +432,6 @@ ...@@ -432,7 +432,6 @@
#temp_tablespaces = '' # a list of tablespace names, '' uses #temp_tablespaces = '' # a list of tablespace names, '' uses
# only default tablespace # only default tablespace
#check_function_bodies = on #check_function_bodies = on
#default_do_language = 'plpgsql'
#default_transaction_isolation = 'read committed' #default_transaction_isolation = 'read committed'
#default_transaction_read_only = off #default_transaction_read_only = off
#session_replication_role = 'origin' #session_replication_role = 'origin'
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* Copyright (c) 2000-2010, PostgreSQL Global Development Group * Copyright (c) 2000-2010, PostgreSQL Global Development Group
* Written by Peter Eisentraut <peter_e@gmx.net>. * Written by Peter Eisentraut <peter_e@gmx.net>.
* *
* $PostgreSQL: pgsql/src/include/utils/guc.h,v 1.111 2010/01/02 16:58:10 momjian Exp $ * $PostgreSQL: pgsql/src/include/utils/guc.h,v 1.112 2010/01/26 16:33:40 tgl Exp $
*-------------------------------------------------------------------- *--------------------------------------------------------------------
*/ */
#ifndef GUC_H #ifndef GUC_H
...@@ -181,8 +181,6 @@ extern char *HbaFileName; ...@@ -181,8 +181,6 @@ extern char *HbaFileName;
extern char *IdentFileName; extern char *IdentFileName;
extern char *external_pid_file; extern char *external_pid_file;
extern char *default_do_language;
extern char *application_name; extern char *application_name;
extern int tcp_keepalives_idle; extern int tcp_keepalives_idle;
......
...@@ -3984,7 +3984,7 @@ BEGIN ...@@ -3984,7 +3984,7 @@ BEGIN
LOOP LOOP
RAISE NOTICE '%, %', r.roomno, r.comment; RAISE NOTICE '%, %', r.roomno, r.comment;
END LOOP; END LOOP;
END$$ LANGUAGE plpgsql; END$$;
NOTICE: 001, Entrance NOTICE: 001, Entrance
NOTICE: 002, Office NOTICE: 002, Office
NOTICE: 003, Office NOTICE: 003, Office
...@@ -4000,7 +4000,7 @@ DO LANGUAGE plpgsql $$begin return 1; end$$; ...@@ -4000,7 +4000,7 @@ DO LANGUAGE plpgsql $$begin return 1; end$$;
ERROR: RETURN cannot have a parameter in function returning void ERROR: RETURN cannot have a parameter in function returning void
LINE 1: DO LANGUAGE plpgsql $$begin return 1; end$$; LINE 1: DO LANGUAGE plpgsql $$begin return 1; end$$;
^ ^
DO LANGUAGE plpgsql $$ DO $$
DECLARE r record; DECLARE r record;
BEGIN BEGIN
FOR r IN SELECT rtrim(roomno) AS roomno, foo FROM Room ORDER BY roomno FOR r IN SELECT rtrim(roomno) AS roomno, foo FROM Room ORDER BY roomno
......
...@@ -3164,12 +3164,12 @@ BEGIN ...@@ -3164,12 +3164,12 @@ BEGIN
LOOP LOOP
RAISE NOTICE '%, %', r.roomno, r.comment; RAISE NOTICE '%, %', r.roomno, r.comment;
END LOOP; END LOOP;
END$$ LANGUAGE plpgsql; END$$;
-- these are to check syntax error reporting -- these are to check syntax error reporting
DO LANGUAGE plpgsql $$begin return 1; end$$; DO LANGUAGE plpgsql $$begin return 1; end$$;
DO LANGUAGE plpgsql $$ DO $$
DECLARE r record; DECLARE r record;
BEGIN BEGIN
FOR r IN SELECT rtrim(roomno) AS roomno, foo FROM Room ORDER BY roomno FOR r IN SELECT rtrim(roomno) AS roomno, foo FROM Room ORDER BY roomno
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment