Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd879697

Browse files
committed
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 patchwas written, because we have since decided that plpgsql should be installedby default. Per discussion, having a parameter for this doesn't seem usefulenough to justify the risk of application breakage if the value is changedunexpectedly.
1 parent6c0f94f commitd879697

File tree

8 files changed

+13
-44
lines changed

8 files changed

+13
-44
lines changed

‎doc/src/sgml/config.sgml

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $PostgreSQL: pgsql/doc/src/sgml/config.sgml,v 1.245 2010/01/23 16:37:12 sriggs Exp $ -->
1+
<!-- $PostgreSQL: pgsql/doc/src/sgml/config.sgml,v 1.246 2010/01/26 16:33:40 tgl Exp $ -->
22

33
<chapter Id="runtime-config">
44
<title>Server Configuration</title>
@@ -4132,21 +4132,6 @@ COPY postgres_log FROM '/full/path/to/logfile.csv' WITH csv;
41324132
</listitem>
41334133
</varlistentry>
41344134

4135-
<varlistentry id="guc-default-do-language" xreflabel="default_do_language">
4136-
<term><varname>default_do_language</varname> (<type>string</type>)</term>
4137-
<indexterm>
4138-
<primary><varname>default_do_language</> configuration parameter</primary>
4139-
</indexterm>
4140-
<listitem>
4141-
<para>
4142-
This parameter specifies the language to use when the
4143-
<literal>LANGUAGE</> option is omitted in a
4144-
<xref linkend="sql-do" endterm="sql-do-title"> statement.
4145-
The default is <literal>plpgsql</literal>.
4146-
</para>
4147-
</listitem>
4148-
</varlistentry>
4149-
41504135
<varlistentry id="guc-default-transaction-isolation" xreflabel="default_transaction_isolation">
41514136
<indexterm>
41524137
<primary>transaction isolation level</primary>

‎doc/src/sgml/ref/do.sgml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$PostgreSQL: pgsql/doc/src/sgml/ref/do.sgml,v 1.2 2009/09/23 15:41:51 tgl Exp $
2+
$PostgreSQL: pgsql/doc/src/sgml/ref/do.sgml,v 1.3 2010/01/26 16:33:40 tgl Exp $
33
PostgreSQL documentation
44
-->
55

@@ -69,8 +69,7 @@ DO <replaceable class="PARAMETER">code</replaceable> [ LANGUAGE <replaceable cla
6969
<listitem>
7070
<para>
7171
The name of the procedural language the code is written in.
72-
If omitted, the default is determined by the runtime parameter
73-
<xref linkend="guc-default-do-language">.
72+
If omitted, the default is <literal>plpgsql</>.
7473
</para>
7574
</listitem>
7675
</varlistentry>
@@ -83,6 +82,7 @@ DO <replaceable class="PARAMETER">code</replaceable> [ LANGUAGE <replaceable cla
8382
<para>
8483
The procedural language to be used must already have been installed
8584
into the current database by means of <command>CREATE LANGUAGE</>.
85+
<literal>plpgsql</> is installed by default, but other languages are not.
8686
</para>
8787

8888
<para>
@@ -108,8 +108,6 @@ BEGIN
108108
END LOOP;
109109
END$$;
110110
</programlisting>
111-
This example assumes that <varname>default_do_language</> has its
112-
default value, namely <literal>plpgsql</>.
113111
</para>
114112
</refsect1>
115113
<refsect1>

‎src/backend/commands/functioncmds.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*
1111
*
1212
* IDENTIFICATION
13-
* $PostgreSQL: pgsql/src/backend/commands/functioncmds.c,v 1.114 2010/01/02 16:57:37 momjian Exp $
13+
* $PostgreSQL: pgsql/src/backend/commands/functioncmds.c,v 1.115 2010/01/26 16:33:40 tgl Exp $
1414
*
1515
* DESCRIPTION
1616
* These routines take the parse tree and pick out the
@@ -2001,11 +2001,11 @@ ExecuteDoStmt(DoStmt *stmt)
20012001
(errcode(ERRCODE_SYNTAX_ERROR),
20022002
errmsg("no inline code specified")));
20032003

2004-
/* if LANGUAGE option wasn't specified, use the defaultlanguage*/
2004+
/* if LANGUAGE option wasn't specified, use the default */
20052005
if (language_item)
20062006
language=strVal(language_item->arg);
20072007
else
2008-
language=default_do_language;
2008+
language="plpgsql";
20092009

20102010
/* Convert language name to canonical case */
20112011
languageName=case_translate_language_name(language);

‎src/backend/utils/misc/guc.c

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* Written by Peter Eisentraut <peter_e@gmx.net>.
1111
*
1212
* IDENTIFICATION
13-
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.535 2010/01/24 21:49:17 tgl Exp $
13+
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.536 2010/01/26 16:33:40 tgl Exp $
1414
*
1515
*--------------------------------------------------------------------
1616
*/
@@ -383,8 +383,6 @@ char *external_pid_file;
383383

384384
char*pgstat_temp_directory;
385385

386-
char*default_do_language;
387-
388386
char*application_name;
389387

390388
inttcp_keepalives_idle;
@@ -2603,15 +2601,6 @@ static struct config_string ConfigureNamesString[] =
26032601
},
26042602
#endif/* USE_SSL */
26052603

2606-
{
2607-
{"default_do_language",PGC_USERSET,CLIENT_CONN_STATEMENT,
2608-
gettext_noop("Sets the language used in DO statement if LANGUAGE is not specified."),
2609-
NULL
2610-
},
2611-
&default_do_language,
2612-
"plpgsql",NULL,NULL
2613-
},
2614-
26152604
{
26162605
{"application_name",PGC_USERSET,LOGGING,
26172606
gettext_noop("Sets the application name to be reported in statistics and logs."),

‎src/backend/utils/misc/postgresql.conf.sample

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,6 @@
432432
#temp_tablespaces = ''# a list of tablespace names, '' uses
433433
# only default tablespace
434434
#check_function_bodies = on
435-
#default_do_language = 'plpgsql'
436435
#default_transaction_isolation = 'read committed'
437436
#default_transaction_read_only = off
438437
#session_replication_role = 'origin'

‎src/include/utils/guc.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Copyright (c) 2000-2010, PostgreSQL Global Development Group
88
* Written by Peter Eisentraut <peter_e@gmx.net>.
99
*
10-
* $PostgreSQL: pgsql/src/include/utils/guc.h,v 1.111 2010/01/02 16:58:10 momjian Exp $
10+
* $PostgreSQL: pgsql/src/include/utils/guc.h,v 1.112 2010/01/26 16:33:40 tgl Exp $
1111
*--------------------------------------------------------------------
1212
*/
1313
#ifndefGUC_H
@@ -181,8 +181,6 @@ extern char *HbaFileName;
181181
externchar*IdentFileName;
182182
externchar*external_pid_file;
183183

184-
externchar*default_do_language;
185-
186184
externchar*application_name;
187185

188186
externinttcp_keepalives_idle;

‎src/test/regress/expected/plpgsql.out

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3984,7 +3984,7 @@ BEGIN
39843984
LOOP
39853985
RAISE NOTICE '%, %', r.roomno, r.comment;
39863986
END LOOP;
3987-
END$$ LANGUAGE plpgsql;
3987+
END$$;
39883988
NOTICE: 001, Entrance
39893989
NOTICE: 002, Office
39903990
NOTICE: 003, Office
@@ -4000,7 +4000,7 @@ DO LANGUAGE plpgsql $$begin return 1; end$$;
40004000
ERROR: RETURN cannot have a parameter in function returning void
40014001
LINE 1: DO LANGUAGE plpgsql $$begin return 1; end$$;
40024002
^
4003-
DOLANGUAGE plpgsql$$
4003+
DO $$
40044004
DECLARE r record;
40054005
BEGIN
40064006
FOR r IN SELECT rtrim(roomno) AS roomno, foo FROM Room ORDER BY roomno

‎src/test/regress/sql/plpgsql.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3164,12 +3164,12 @@ BEGIN
31643164
LOOP
31653165
RAISE NOTICE'%, %', r.roomno, r.comment;
31663166
END LOOP;
3167-
END$$ LANGUAGE plpgsql;
3167+
END$$;
31683168
31693169
-- these are to check syntax error reporting
31703170
DO LANGUAGE plpgsql $$begin return 1; end$$;
31713171
3172-
DOLANGUAGE plpgsql$$
3172+
DO $$
31733173
DECLARE r record;
31743174
BEGIN
31753175
FOR r IN SELECT rtrim(roomno) AS roomno, foo FROM Room ORDER BY roomno

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp