Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lKA6Z-0007eK-9d for pgsql-docs@arkaria.postgresql.org; Thu, 11 Mar 2021 01:27:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lKA6Y-0004kj-8l for pgsql-docs@arkaria.postgresql.org; Thu, 11 Mar 2021 01:27:10 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lKA6Y-0004kW-3B for pgsql-docs@lists.postgresql.org; Thu, 11 Mar 2021 01:27:10 +0000 Received: from momjian.us ([72.94.173.45]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lKA6V-0002p9-Kt for pgsql-docs@lists.postgresql.org; Thu, 11 Mar 2021 01:27:09 +0000 Received: from bruce by momjian.us with local (Exim 4.92) (envelope-from ) id 1lKA6U-0007Ci-0g; Wed, 10 Mar 2021 20:27:06 -0500 Date: Wed, 10 Mar 2021 20:27:06 -0500 From: Bruce Momjian To: max1@inbox.ru, pgsql-docs@lists.postgresql.org Subject: Re: advanced.sql tutorial script Message-ID: <20210311012705.GD11261@momjian.us> References: <161512392887.1046.3137472627109459518@wrigleys.postgresql.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="pf9I7BMVVzbSWLtt" Content-Disposition: inline In-Reply-To: <161512392887.1046.3137472627109459518@wrigleys.postgresql.org> User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --pf9I7BMVVzbSWLtt Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sun, Mar 7, 2021 at 01:32:08PM +0000, PG Doc comments form wrote: > The following documentation comment has been logged on the website: > > Page: https://www.postgresql.org/docs/13/tutorial-advanced-intro.html > Description: > > I built tutorial files according to instructions from the section 2.1. And I > found that the script advanced.sql covers only the section "3.6. > Inheritance". There are no any statements related to "3.2. Views", "3.3. > Foreign Keys", "3.4. Transactions" and "3.5. Window Functions". > Also there is a difference between the script and the documentation in > relation to Inheritance. > > In src/tutorial/advanced.sql: > CREATE TABLE cities ( > name text, > population float8, > altitude int -- (in ft) > ); > > In documentation > https://www.postgresql.org/docs/13/tutorial-inheritance.html : > CREATE TABLE cities ( > name text, > population real, > elevation int -- (in ft) > ); > > So, advanced.sql should be updated with statements from sections 3.2-3.5 and > with new table structures from 3.6. Oops, I updated the docs to use "elevation" in this patch: commit 92c12e46d5 Author: Bruce Momjian Date: Wed Apr 22 16:23:19 2020 -0400 docs: land height is "elevation", not "altitude" See https://mapscaping.com/blogs/geo-candy/what-is-the-difference-between-elevation-relief-and-altitude No patching of regression tests. Reported-by: taf1@cornell.edu Discussion: https://postgr.es/m/158506544539.679.2278386310645558048@wrigleys.postgresql.org Backpatch-through: 9.5 but missed the tutorial mention. This is fixed in the attached, applied patch. Thanks for the report. -- Bruce Momjian https://momjian.us EDB https://enterprisedb.com The usefulness of a cup is in its emptiness, Bruce Lee --pf9I7BMVVzbSWLtt Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="master.diff" diff --git a/src/tutorial/advanced.source b/src/tutorial/advanced.source index 1130784d4d..0c68b3344c 100644 --- a/src/tutorial/advanced.source +++ b/src/tutorial/advanced.source @@ -23,7 +23,7 @@ CREATE TABLE cities ( name text, population float8, - altitude int -- (in ft) + elevation int -- (in ft) ); CREATE TABLE capitals ( @@ -42,17 +42,17 @@ SELECT * FROM cities; SELECT * FROM capitals; -- You can find all cities, including capitals, that --- are located at an altitude of 500 ft or higher by: +-- are located at an elevation of 500 ft or higher by: -SELECT c.name, c.altitude +SELECT c.name, c.elevation FROM cities c -WHERE c.altitude > 500; +WHERE c.elevation > 500; -- To scan rows of the parent table only, use ONLY: -SELECT name, altitude +SELECT name, elevation FROM ONLY cities -WHERE altitude > 500; +WHERE elevation > 500; -- clean up (you must remove the children first) --pf9I7BMVVzbSWLtt--