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

Commite13486e

Browse files
committed
Remove sql_inheritance GUC.
This backward-compatibility GUC is long overdue for removal.Discussion:http://postgr.es/m/CA+TgmoYe+EG7LdYX6pkcNxr4ygkP4+A=jm9o-CPXyOvRiCNwaQ@mail.gmail.com
1 parent7819ba1 commite13486e

File tree

14 files changed

+20
-93
lines changed

14 files changed

+20
-93
lines changed

‎doc/src/sgml/config.sgml

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -7394,36 +7394,6 @@ dynamic_library_path = 'C:\tools\postgresql;H:\my_project\lib;$libdir'
73947394
</listitem>
73957395
</varlistentry>
73967396

7397-
<varlistentry id="guc-sql-inheritance" xreflabel="sql_inheritance">
7398-
<term><varname>sql_inheritance</varname> (<type>boolean</type>)
7399-
<indexterm>
7400-
<primary><varname>sql_inheritance</> configuration parameter</primary>
7401-
</indexterm>
7402-
<indexterm><primary>inheritance</></>
7403-
</term>
7404-
<listitem>
7405-
<para>
7406-
This setting controls whether undecorated table references are
7407-
considered to include inheritance child tables. The default is
7408-
<literal>on</>, which means child tables are included (thus,
7409-
a <literal>*</> suffix is assumed by default). If turned
7410-
<literal>off</>, child tables are not included (thus, an
7411-
<literal>ONLY</literal> prefix is assumed). The SQL standard
7412-
requires child tables to be included, so the <literal>off</> setting
7413-
is not spec-compliant, but it is provided for compatibility with
7414-
<productname>PostgreSQL</> releases prior to 7.1.
7415-
See <xref linkend="ddl-inherit"> for more information.
7416-
</para>
7417-
7418-
<para>
7419-
Turning <varname>sql_inheritance</> off is deprecated, because that
7420-
behavior has been found to be error-prone as well as contrary to SQL
7421-
standard. Discussions of inheritance behavior elsewhere in this
7422-
manual generally assume that it is <literal>on</>.
7423-
</para>
7424-
</listitem>
7425-
</varlistentry>
7426-
74277397
<varlistentry id="guc-standard-conforming-strings" xreflabel="standard_conforming_strings">
74287398
<term><varname>standard_conforming_strings</varname> (<type>boolean</type>)
74297399
<indexterm><primary>strings</><secondary>standard conforming</></>

‎doc/src/sgml/ddl.sgml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2529,11 +2529,9 @@ SELECT name, altitude
25292529
WHERE altitude &gt; 500;
25302530
</programlisting>
25312531

2532-
Writing <literal>*</> is not necessary, since this behavior is
2533-
the default (unless you have changed the setting of the
2534-
<xref linkend="guc-sql-inheritance"> configuration option).
2535-
However writing <literal>*</> might be useful to emphasize that
2536-
additional tables will be searched.
2532+
Writing <literal>*</> is not necessary, since this behavior is always
2533+
the default. However, this syntax is still supported for
2534+
compatibility with older releases where the default could be changed.
25372535
</para>
25382536

25392537
<para>

‎doc/src/sgml/queries.sgml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -145,11 +145,9 @@ FROM <replaceable>table_reference</replaceable> <optional>, <replaceable>table_r
145145
<para>
146146
Instead of writing <literal>ONLY</> before the table name, you can write
147147
<literal>*</> after the table name to explicitly specify that descendant
148-
tables are included. Writing <literal>*</> is not necessary since that
149-
behavior is the default (unless you have changed the setting of the <xref
150-
linkend="guc-sql-inheritance"> configuration option). However writing
151-
<literal>*</> might be useful to emphasize that additional tables will be
152-
searched.
148+
tables are included. There is no real reason to use this syntax any more,
149+
because searching descendent tables is now always the default behavior.
150+
However, it is supported for compatibility with older releases.
153151
</para>
154152

155153
<sect3 id="queries-join">

‎src/backend/commands/lockcmds.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ LockTableCommand(LockStmt *lockstmt)
5454
foreach(p,lockstmt->relations)
5555
{
5656
RangeVar*rv= (RangeVar*)lfirst(p);
57-
boolrecurse=interpretInhOption(rv->inhOpt);
57+
boolrecurse= (rv->inhOpt==INH_YES);
5858
Oidreloid;
5959

6060
reloid=RangeVarGetRelidExtended(rv,lockstmt->mode, false,

‎src/backend/commands/tablecmds.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1184,7 +1184,7 @@ ExecuteTruncate(TruncateStmt *stmt)
11841184
{
11851185
RangeVar*rv=lfirst(cell);
11861186
Relationrel;
1187-
boolrecurse=interpretInhOption(rv->inhOpt);
1187+
boolrecurse= (rv->inhOpt==INH_YES);
11881188
Oidmyrelid;
11891189

11901190
rel=heap_openrv(rv,AccessExclusiveLock);
@@ -2655,7 +2655,7 @@ renameatt(RenameStmt *stmt)
26552655
renameatt_internal(relid,
26562656
stmt->subname,/* old att name */
26572657
stmt->newname,/* new att name */
2658-
interpretInhOption(stmt->relation->inhOpt),/* recursive? */
2658+
(stmt->relation->inhOpt==INH_YES),/* recursive? */
26592659
false,/* recursing? */
26602660
0,/* expected inhcount */
26612661
stmt->behavior);
@@ -2807,7 +2807,7 @@ RenameConstraint(RenameStmt *stmt)
28072807
rename_constraint_internal(relid,typid,
28082808
stmt->subname,
28092809
stmt->newname,
2810-
stmt->relation?interpretInhOption(stmt->relation->inhOpt) : false,/* recursive? */
2810+
(stmt->relation&&stmt->relation->inhOpt==INH_YES),/* recursive? */
28112811
false,/* recursing? */
28122812
0/* expected inhcount */ );
28132813

@@ -3050,7 +3050,7 @@ AlterTable(Oid relid, LOCKMODE lockmode, AlterTableStmt *stmt)
30503050
CheckTableNotInUse(rel,"ALTER TABLE");
30513051

30523052
ATController(stmt,
3053-
rel,stmt->cmds,interpretInhOption(stmt->relation->inhOpt),
3053+
rel,stmt->cmds, (stmt->relation->inhOpt==INH_YES),
30543054
lockmode);
30553055
}
30563056

‎src/backend/nodes/makefuncs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ makeRangeVar(char *schemaname, char *relname, int location)
423423
r->catalogname=NULL;
424424
r->schemaname=schemaname;
425425
r->relname=relname;
426-
r->inhOpt=INH_DEFAULT;
426+
r->inhOpt=INH_YES;
427427
r->relpersistence=RELPERSISTENCE_PERMANENT;
428428
r->alias=NULL;
429429
r->location=location;

‎src/backend/parser/analyze.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ transformDeleteStmt(ParseState *pstate, DeleteStmt *stmt)
380380

381381
/* set up range table with just the result rel */
382382
qry->resultRelation=setTargetTable(pstate,stmt->relation,
383-
interpretInhOption(stmt->relation->inhOpt),
383+
(stmt->relation->inhOpt==INH_YES),
384384
true,
385385
ACL_DELETE);
386386

@@ -2177,7 +2177,7 @@ transformUpdateStmt(ParseState *pstate, UpdateStmt *stmt)
21772177
}
21782178

21792179
qry->resultRelation=setTargetTable(pstate,stmt->relation,
2180-
interpretInhOption(stmt->relation->inhOpt),
2180+
(stmt->relation->inhOpt==INH_YES),
21812181
true,
21822182
ACL_UPDATE);
21832183

‎src/backend/parser/gram.y

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,11 @@
2828
* current transaction and are just parsing commands to find the next
2929
* ROLLBACK or COMMIT. If you make use of SET variables, then you
3030
* will do the wrong thing in multi-query strings like this:
31-
*SETSQL_inheritance TO off; SELECT * FROM foo;
31+
*SETconstraint_exclusion TO off; SELECT * FROM foo;
3232
* because the entire string is parsed by gram.y before the SET gets
3333
* executed. Anything that depends on the database or changeable state
3434
* should be handled during parse analysis so that it happens at the
35-
* right time not the wrong time. The handling of SQL_inheritance is
36-
* a good example.
35+
* right time not the wrong time.
3736
*
3837
* WARNINGS
3938
* If you use a list, make sure the datum is a node so that the printing
@@ -11249,9 +11248,9 @@ join_qual:USING '(' name_list ')'{ $$ = (Node *) $3; }
1124911248
relation_expr:
1125011249
qualified_name
1125111250
{
11252-
/*defaultinheritance*/
11251+
/* inheritance query, implicitly*/
1125311252
$$ =$1;
11254-
$$->inhOpt =INH_DEFAULT;
11253+
$$->inhOpt =INH_YES;
1125511254
$$->alias =NULL;
1125611255
}
1125711256
|qualified_name'*'

‎src/backend/parser/parse_clause.c

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -228,30 +228,6 @@ setTargetTable(ParseState *pstate, RangeVar *relation,
228228
returnrtindex;
229229
}
230230

231-
/*
232-
* Simplify InhOption (yes/no/default) into boolean yes/no.
233-
*
234-
* The reason we do things this way is that we don't want to examine the
235-
* SQL_inheritance option flag until parse_analyze() is run. Otherwise,
236-
* we'd do the wrong thing with query strings that intermix SET commands
237-
* with queries.
238-
*/
239-
bool
240-
interpretInhOption(InhOptioninhOpt)
241-
{
242-
switch (inhOpt)
243-
{
244-
caseINH_NO:
245-
return false;
246-
caseINH_YES:
247-
return true;
248-
caseINH_DEFAULT:
249-
returnSQL_inheritance;
250-
}
251-
elog(ERROR,"bogus InhOption value: %d",inhOpt);
252-
return false;/* keep compiler quiet */
253-
}
254-
255231
/*
256232
* Given a relation-options list (of DefElems), return true iff the specified
257233
* table/result set should be created with OIDs. This needs to be done after
@@ -437,7 +413,7 @@ transformTableEntry(ParseState *pstate, RangeVar *r)
437413

438414
/* We need only build a range table entry */
439415
rte=addRangeTableEntry(pstate,r,r->alias,
440-
interpretInhOption(r->inhOpt), true);
416+
(r->inhOpt==INH_YES), true);
441417

442418
returnrte;
443419
}

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

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,6 @@ char *event_source;
440440
boolrow_security;
441441
boolcheck_function_bodies= true;
442442
booldefault_with_oids= false;
443-
boolSQL_inheritance= true;
444443

445444
intlog_min_error_statement=ERROR;
446445
intlog_min_messages=WARNING;
@@ -1321,15 +1320,6 @@ static struct config_bool ConfigureNamesBool[] =
13211320
false,
13221321
NULL,NULL,NULL
13231322
},
1324-
{
1325-
{"sql_inheritance",PGC_USERSET,COMPAT_OPTIONS_PREVIOUS,
1326-
gettext_noop("Causes subtables to be included by default in various commands."),
1327-
NULL
1328-
},
1329-
&SQL_inheritance,
1330-
true,
1331-
NULL,NULL,NULL
1332-
},
13331323
{
13341324
{"transform_null_equals",PGC_USERSET,COMPAT_OPTIONS_CLIENT,
13351325
gettext_noop("Treats \"expr=NULL\" as \"expr IS NULL\"."),

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,6 @@
606606
#lo_compat_privileges = off
607607
#operator_precedence_warning = off
608608
#quote_all_identifiers = off
609-
#sql_inheritance = on
610609
#standard_conforming_strings = on
611610
#synchronize_seqscans = on
612611

‎src/include/nodes/primnodes.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,7 @@ typedef struct Alias
4545
typedefenumInhOption
4646
{
4747
INH_NO,/* Do NOT scan child tables */
48-
INH_YES,/* DO scan child tables */
49-
INH_DEFAULT/* Use current SQL_inheritance option */
48+
INH_YES/* DO scan child tables */
5049
}InhOption;
5150

5251
/* What to do at commit time for temporary relations */

‎src/include/parser/parse_clause.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
externvoidtransformFromClause(ParseState*pstate,List*frmList);
2020
externintsetTargetTable(ParseState*pstate,RangeVar*relation,
2121
boolinh,boolalsoSource,AclModerequiredPerms);
22-
externboolinterpretInhOption(InhOptioninhOpt);
2322
externboolinterpretOidsOption(List*defList,boolallowOids);
2423

2524
externNode*transformWhereClause(ParseState*pstate,Node*clause,

‎src/include/utils/guc.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,6 @@ extern bool log_btree_build_stats;
244244

245245
externPGDLLIMPORTboolcheck_function_bodies;
246246
externbooldefault_with_oids;
247-
externboolSQL_inheritance;
248247

249248
externintlog_min_error_statement;
250249
externintlog_min_messages;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp