Re: 3.3. Foreign Keys

From: Kirk Parker <khp(at)equatoria(dot)us>
To: jonahcrespo(at)gmail(dot)com, pgsql-docs(at)lists(dot)postgresql(dot)org
Subject: Re: 3.3. Foreign Keys
Date: 2025-03-11 10:50:07
Message-ID: CANwZ8r==nBvgykWGZXRF6_L+_p4wicoT+SkjxAqBfnvAWv_j0w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

On Tue, Mar 11, 2025, 02:37 PG Doc comments form <noreply(at)postgresql(dot)org>
wrote:

> The following documentation comment has been logged on the website:
>
> Page: https://www.postgresql.org/docs/17/tutorial-fk.html
> Description:
>
> While going through the documentation in a sequential manner, attempting to
> create TABLE cities creates an error as “relation cities” already exists.
> I am still figuring out how to proceed to create the referential rule.
> Thanks,
>

If you've been working through the tutorial sequentially in the same
database and not "cleaning up" after your previous chapters, then indeed
the 'cities' table already exists because you created it in chapter 2.

Part of the (implicit or explicit?) style guide of the tutorial is that
each chapter should be comprehensible on its own. The reader might have
arrived there through a web search rather than linearly, and the opening
sentence "Recall the weather and cities tables from Chapter 2
<https://www.postgresql.org/docs/17/tutorial-sql.html>..." is meant as a
casual hint that the results of those earlier chapters might persist. I'm
not sure we want to engage in more detailed or formalistic set of warnings
at the expense of readability of the current chapter -- for example by
saying "your first need to drop these tables if they still exist from being
created in a previous chapter".

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Robert Treat 2025-03-16 16:18:05 Re: 3.3. Foreign Keys
Previous Message PG Doc comments form 2025-03-11 00:47:36 3.3. Foreign Keys