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 1jJQ1T-0000Oa-OE for pgsql-docs@arkaria.postgresql.org; Tue, 31 Mar 2020 23:10:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jJQ1S-0005Tj-K5 for pgsql-docs@arkaria.postgresql.org; Tue, 31 Mar 2020 23:10:18 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jJQ1S-0005Tb-A2 for pgsql-docs@lists.postgresql.org; Tue, 31 Mar 2020 23:10:18 +0000 Received: from momjian.us ([72.94.173.45]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jJQ1P-0006Rg-Qx for pgsql-docs@lists.postgresql.org; Tue, 31 Mar 2020 23:10:17 +0000 Received: from bruce by momjian.us with local (Exim 4.92) (envelope-from ) id 1jJQ1N-0002GK-8C; Tue, 31 Mar 2020 19:10:13 -0400 Date: Tue, 31 Mar 2020 19:10:13 -0400 From: Bruce Momjian To: taf1@cornell.edu, pgsql-docs@lists.postgresql.org Subject: Re: terminology in example Message-ID: <20200331231013.GJ17676@momjian.us> References: <158506544539.679.2278386310645558048@wrigleys.postgresql.org> <20200324174141.GC4828@momjian.us> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="gBBFr7Ir9EOA20Yy" Content-Disposition: inline In-Reply-To: <20200324174141.GC4828@momjian.us> User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --gBBFr7Ir9EOA20Yy Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Mar 24, 2020 at 01:41:41PM -0400, Bruce Momjian wrote: > On Tue, Mar 24, 2020 at 03:57:25PM +0000, PG Doc comments form wrote: > > The following documentation comment has been logged on the website: > > > > Page: https://www.postgresql.org/docs/12/ddl-inherit.html > > Description: > > > > In the example on this page: > > https://www.postgresql.org/docs/current/ddl-inherit.html > > the word 'altitude' should be replaced with 'elevation'. > > Yes, I see your point: > > https://mapscaping.com/blogs/geo-candy/what-is-the-difference-between-elevation-relief-and-altitude The attached patch fixes the problem. The regression tests also have many mentions of "altitude." Should those be changed too? -- Bruce Momjian https://momjian.us EnterpriseDB https://enterprisedb.com + As you are, so once was I. As I am, so you will be. + + Ancient Roman grave inscription + --gBBFr7Ir9EOA20Yy Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="elevation.diff" diff --git a/doc/src/sgml/advanced.sgml b/doc/src/sgml/advanced.sgml index ae5f3fac75..be14d15b3f 100644 --- a/doc/src/sgml/advanced.sgml +++ b/doc/src/sgml/advanced.sgml @@ -585,20 +585,20 @@ SELECT sum(salary) OVER w, avg(salary) OVER w CREATE TABLE capitals ( name text, population real, - altitude int, -- (in ft) + elevation int, -- (in ft) state char(2) ); CREATE TABLE non_capitals ( name text, population real, - altitude int -- (in ft) + elevation int -- (in ft) ); CREATE VIEW cities AS - SELECT name, population, altitude FROM capitals + SELECT name, population, elevation FROM capitals UNION - SELECT name, population, altitude FROM non_capitals; + SELECT name, population, elevation FROM non_capitals; This works OK as far as querying goes, but it gets ugly when you @@ -612,7 +612,7 @@ CREATE VIEW cities AS CREATE TABLE cities ( name text, population real, - altitude int -- (in ft) + elevation int -- (in ft) ); CREATE TABLE capitals ( @@ -624,7 +624,7 @@ CREATE TABLE capitals ( In this case, a row of capitals inherits all columns (name, - population, and altitude) from its + population, and elevation) from its parent, cities. The type of the column name is text, a native PostgreSQL @@ -636,23 +636,23 @@ CREATE TABLE capitals ( For example, the following query finds the names of all cities, - including state capitals, that are located at an altitude + including state capitals, that are located at an elevation over 500 feet: -SELECT name, altitude +SELECT name, elevation FROM cities - WHERE altitude > 500; + WHERE elevation > 500; which returns: - name | altitude ------------+---------- - Las Vegas | 2174 - Mariposa | 1953 - Madison | 845 + name | elevation +-----------+----------- + Las Vegas | 2174 + Mariposa | 1953 + Madison | 845 (3 rows) @@ -660,19 +660,19 @@ SELECT name, altitude On the other hand, the following query finds all the cities that are not state capitals and - are situated at an altitude over 500 feet: + are situated at an elevation over 500 feet: -SELECT name, altitude +SELECT name, elevation FROM ONLY cities - WHERE altitude > 500; + WHERE elevation > 500; - name | altitude ------------+---------- - Las Vegas | 2174 - Mariposa | 1953 + name | elevation +-----------+----------- + Las Vegas | 2174 + Mariposa | 1953 (2 rows) diff --git a/doc/src/sgml/ddl.sgml b/doc/src/sgml/ddl.sgml index ab27645319..d84214f277 100644 --- a/doc/src/sgml/ddl.sgml +++ b/doc/src/sgml/ddl.sgml @@ -3157,7 +3157,7 @@ REVOKE CREATE ON SCHEMA public FROM PUBLIC; CREATE TABLE cities ( name text, population float, - altitude int -- in feet + elevation int -- in feet ); CREATE TABLE capitals ( @@ -3177,40 +3177,40 @@ CREATE TABLE capitals ( rows of a table or all rows of a table plus all of its descendant tables. The latter behavior is the default. For example, the following query finds the names of all cities, - including state capitals, that are located at an altitude over + including state capitals, that are located at an elevation over 500 feet: -SELECT name, altitude +SELECT name, elevation FROM cities - WHERE altitude > 500; + WHERE elevation > 500; Given the sample data from the PostgreSQL tutorial (see ), this returns: - name | altitude ------------+---------- - Las Vegas | 2174 - Mariposa | 1953 - Madison | 845 + name | elevation +-----------+----------- + Las Vegas | 2174 + Mariposa | 1953 + Madison | 845 On the other hand, the following query finds all the cities that - are not state capitals and are situated at an altitude over 500 feet: + are not state capitals and are situated at an elevation over 500 feet: -SELECT name, altitude +SELECT name, elevation FROM ONLY cities - WHERE altitude > 500; + WHERE elevation > 500; - name | altitude ------------+---------- - Las Vegas | 2174 - Mariposa | 1953 + name | elevation +-----------+----------- + Las Vegas | 2174 + Mariposa | 1953 @@ -3229,9 +3229,9 @@ SELECT name, altitude to explicitly specify that descendant tables are included: -SELECT name, altitude +SELECT name, elevation FROM cities* - WHERE altitude > 500; + WHERE elevation > 500; Writing * is not necessary, since this behavior is always @@ -3246,19 +3246,19 @@ SELECT name, altitude originating table: -SELECT c.tableoid, c.name, c.altitude +SELECT c.tableoid, c.name, c.elevation FROM cities c -WHERE c.altitude > 500; +WHERE c.elevation > 500; which returns: - tableoid | name | altitude -----------+-----------+---------- - 139793 | Las Vegas | 2174 - 139793 | Mariposa | 1953 - 139798 | Madison | 845 + tableoid | name | elevation +----------+-----------+----------- + 139793 | Las Vegas | 2174 + 139793 | Mariposa | 1953 + 139798 | Madison | 845 (If you try to reproduce this example, you will probably get @@ -3266,19 +3266,19 @@ WHERE c.altitude > 500; pg_class you can see the actual table names: -SELECT p.relname, c.name, c.altitude +SELECT p.relname, c.name, c.elevation FROM cities c, pg_class p -WHERE c.altitude > 500 AND c.tableoid = p.oid; +WHERE c.elevation > 500 AND c.tableoid = p.oid; which returns: - relname | name | altitude -----------+-----------+---------- - cities | Las Vegas | 2174 - cities | Mariposa | 1953 - capitals | Madison | 845 + relname | name | elevation +----------+-----------+----------- + cities | Las Vegas | 2174 + cities | Mariposa | 1953 + capitals | Madison | 845 @@ -3287,9 +3287,9 @@ WHERE c.altitude > 500 AND c.tableoid = p.oid; alias type, which will print the table OID symbolically: -SELECT c.tableoid::regclass, c.name, c.altitude +SELECT c.tableoid::regclass, c.name, c.elevation FROM cities c -WHERE c.altitude > 500; +WHERE c.elevation > 500; @@ -3299,7 +3299,7 @@ WHERE c.altitude > 500; other tables in the inheritance hierarchy. In our example, the following INSERT statement will fail: -INSERT INTO cities (name, population, altitude, state) +INSERT INTO cities (name, population, elevation, state) VALUES ('Albany', NULL, NULL, 'NY'); We might hope that the data would somehow be routed to the --gBBFr7Ir9EOA20Yy--