diff options
Diffstat (limited to 'doc/src/sgml/ddl.sgml')
-rw-r--r-- | doc/src/sgml/ddl.sgml | 37 |
1 files changed, 21 insertions, 16 deletions
diff --git a/doc/src/sgml/ddl.sgml b/doc/src/sgml/ddl.sgml index 038f92e1d52..d0fcdc74e0b 100644 --- a/doc/src/sgml/ddl.sgml +++ b/doc/src/sgml/ddl.sgml @@ -2051,6 +2051,23 @@ SELECT name, altitude </para> <para> + You can also write the table name with a trailing <literal>*</> + to explicitly specify that descendant tables are included: + +<programlisting> +SELECT name, altitude + FROM cities* + WHERE altitude > 500; +</programlisting> + + Writing <literal>*</> is not necessary, since this behavior is + the default (unless you have changed the setting of the + <xref linkend="guc-sql-inheritance"> configuration option). + However writing <literal>*</> might be useful to emphasize that + additional tables will be searched. + </para> + + <para> In some cases you might wish to know which table a particular row originated from. There is a system column called <structfield>tableoid</structfield> in each table which can tell you the @@ -2197,15 +2214,15 @@ VALUES ('New York', NULL, NULL, 'NY'); data modification, or schema modification (e.g., <literal>SELECT</literal>, <literal>UPDATE</literal>, <literal>DELETE</literal>, most variants of <literal>ALTER TABLE</literal>, but - not <literal>INSERT</literal> and <literal>ALTER TABLE ... + not <literal>INSERT</literal> or <literal>ALTER TABLE ... RENAME</literal>) typically default to including child tables and support the <literal>ONLY</literal> notation to exclude them. Commands that do database maintenance and tuning (e.g., <literal>REINDEX</literal>, <literal>VACUUM</literal>) - typically only work on individual, physical tables and do no + typically only work on individual, physical tables and do not support recursing over inheritance hierarchies. The respective - behavior of each individual command is documented in the reference - part (<xref linkend="sql-commands">). + behavior of each individual command is documented in its reference + page (<xref linkend="sql-commands">). </para> <para> @@ -2255,18 +2272,6 @@ VALUES ('New York', NULL, NULL, 'NY'); inheritance is useful for your application. </para> - <note> - <title>Deprecated</title> - <para> - In releases of <productname>PostgreSQL</productname> prior to 7.1, the - default behavior was not to include child tables in queries. This was - found to be error prone and also in violation of the SQL - standard. You can get the pre-7.1 behavior by turning off the - <xref linkend="guc-sql-inheritance"> configuration - option. - </para> - </note> - </sect2> </sect1> |