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 1lspSe-0004IY-N1 for pgsql-docs@arkaria.postgresql.org; Mon, 14 Jun 2021 16:29:16 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lspSd-0003oH-Md for pgsql-docs@arkaria.postgresql.org; Mon, 14 Jun 2021 16:29:15 +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 1lspSd-0003o9-GV for pgsql-docs@lists.postgresql.org; Mon, 14 Jun 2021 16:29:15 +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 1lspSa-0000xg-VS for pgsql-docs@lists.postgresql.org; Mon, 14 Jun 2021 16:29:15 +0000 Received: from bruce by momjian.us with local (Exim 4.92) (envelope-from ) id 1lspSX-0007A8-TI; Mon, 14 Jun 2021 12:29:09 -0400 Date: Mon, 14 Jun 2021 12:29:09 -0400 From: Bruce Momjian To: "David G. Johnston" Cc: Tom Jakubowski , Pg Docs Subject: Re: Cities name column name inconsistent Message-ID: <20210614162909.GA18585@momjian.us> References: <162345756191.14472.9754568432103008703@wrigleys.postgresql.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="LZvS9be/3tNcYl/X" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: 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 --LZvS9be/3tNcYl/X Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit On Sat, Jun 12, 2021 at 12:48:25PM -0700, David G. Johnston wrote: > > On Sat, Jun 12, 2021, 12:28 PG Doc comments form > wrote: > > The following documentation comment has been logged on the website: > > Page: https://www.postgresql.org/docs/13/tutorial-fk.html > Description: > > In earlier sections of the tutorial, the cities table had a column called > 'name'. In this chapter, when creating the revised schema with foreign > keys, > the same column in the cities is now called 'city'. > > > You are correct.  I don't see an urgent need to spend time figuring out > something different. I wrote the attached patch to improve this case. -- Bruce Momjian https://momjian.us EDB https://enterprisedb.com If only the physical world exists, free will is an illusion. --LZvS9be/3tNcYl/X Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="cities.diff" diff --git a/doc/src/sgml/advanced.sgml b/doc/src/sgml/advanced.sgml index 2d4ab85d45..71ae423f63 100644 --- a/doc/src/sgml/advanced.sgml +++ b/doc/src/sgml/advanced.sgml @@ -46,7 +46,7 @@ CREATE VIEW myview AS - SELECT city, temp_lo, temp_hi, prcp, date, location + SELECT name, temp_lo, temp_hi, prcp, date, location FROM weather, cities WHERE city = name; @@ -101,12 +101,12 @@ SELECT * FROM myview; CREATE TABLE cities ( - city varchar(80) primary key, + name varchar(80) primary key, location point ); CREATE TABLE weather ( - city varchar(80) references cities(city), + city varchar(80) references cities(name), temp_lo int, temp_hi int, prcp real, --LZvS9be/3tNcYl/X--