public inbox for [email protected]  
help / color / mirror / Atom feed
Cities name column name inconsistent
5+ messages / 4 participants
[nested] [flat]

* Cities name column name inconsistent
@ 2021-06-12 00:26  PG Doc comments form <[email protected]>
  0 siblings, 1 reply; 5+ messages in thread

From: PG Doc comments form @ 2021-06-12 00:26 UTC (permalink / raw)
  To: [email protected]; +Cc: [email protected]

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'.


^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Cities name column name inconsistent
@ 2021-06-12 19:48  David G. Johnston <[email protected]>
  parent: PG Doc comments form <[email protected]>
  0 siblings, 1 reply; 5+ messages in thread

From: David G. Johnston @ 2021-06-12 19:48 UTC (permalink / raw)
  To: Tom Jakubowski <[email protected]>; Pg Docs <[email protected]>

On Sat, Jun 12, 2021, 12:28 PG Doc comments form <[email protected]>
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.

David J.


^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Cities name column name inconsistent
@ 2021-06-14 16:29  Bruce Momjian <[email protected]>
  parent: David G. Johnston <[email protected]>
  0 siblings, 1 reply; 5+ messages in thread

From: Bruce Momjian @ 2021-06-14 16:29 UTC (permalink / raw)
  To: David G. Johnston <[email protected]>; +Cc: Tom Jakubowski <[email protected]>; Pg Docs <[email protected]>

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 <[email protected]>
> 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  <[email protected]>        https://momjian.us
  EDB                                      https://enterprisedb.com

  If only the physical world exists, free will is an illusion.



Attachments:

  [text/x-diff] cities.diff (818B, 2-cities.diff)
  download | inline 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 @@
 
 <programlisting>
 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;
 
 <programlisting>
 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,


^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Cities name column name inconsistent
@ 2021-06-24 11:24  Peter Eisentraut <[email protected]>
  parent: Bruce Momjian <[email protected]>
  0 siblings, 1 reply; 5+ messages in thread

From: Peter Eisentraut @ 2021-06-24 11:24 UTC (permalink / raw)
  To: Bruce Momjian <[email protected]>; David G. Johnston <[email protected]>; +Cc: Tom Jakubowski <[email protected]>; Pg Docs <[email protected]>

On 14.06.21 18:29, Bruce Momjian wrote:
> 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 <[email protected]>
>> 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.

The tutorial documentation is meant to be consistent with src/tutorial/, 
which uses cities.name, so calling the column "city" was just plain 
wrong in that respect.





^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Cities name column name inconsistent
@ 2021-07-03 00:43  Bruce Momjian <[email protected]>
  parent: Peter Eisentraut <[email protected]>
  0 siblings, 0 replies; 5+ messages in thread

From: Bruce Momjian @ 2021-07-03 00:43 UTC (permalink / raw)
  To: Peter Eisentraut <[email protected]>; +Cc: David G. Johnston <[email protected]>; Tom Jakubowski <[email protected]>; Pg Docs <[email protected]>

On Thu, Jun 24, 2021 at 01:24:01PM +0200, Peter Eisentraut wrote:
> On 14.06.21 18:29, Bruce Momjian wrote:
> > 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 <[email protected]>
> > > 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.
> 
> The tutorial documentation is meant to be consistent with src/tutorial/,
> which uses cities.name, so calling the column "city" was just plain wrong in
> that respect.

Patch applied back to 9.6.

-- 
  Bruce Momjian  <[email protected]>        https://momjian.us
  EDB                                      https://enterprisedb.com

  If only the physical world exists, free will is an illusion.







^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2021-07-03 00:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-06-12 00:26 Cities name column name inconsistent PG Doc comments form <[email protected]>
2021-06-12 19:48 ` David G. Johnston <[email protected]>
2021-06-14 16:29   ` Bruce Momjian <[email protected]>
2021-06-24 11:24     ` Peter Eisentraut <[email protected]>
2021-07-03 00:43       ` Bruce Momjian <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox