Re: pg_catalog tables don't have constraints?

From: "" <kbrannen(at)pwhome(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Re: pg_catalog tables don't have constraints?
Date: 2017-06-13 22:24:44
Message-ID: 20170613152444.677A1521@m0117565.ppops.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Thomas Kellerer wrote:
> kbrannen(at)pwhome(dot)com schrieb am 09.06.2017 um 20:57:
> > Neil Anderson <neil(at)postgrescompare(dot)com> wrote:
> >
> >> I've been exploring the pg_catalog tables and pointed a couple of
> >> tools at it to extract an ER diagram for a blog post. At first I
> >> thought it was a bug in the drawing tool but it appears that the
> >> relationships between the pg_catalog tables are implicit rather than
> >> enforced by the database, is that correct?
> >
> > Every time I have to dive into the pg_* tables, I really want such a
> > diagram because the relationships aren't obvious to me, so I've been
> > looking for a diagram like that and haven't found one.
>
> https://wiki.postgresql.org/wiki/Developer_FAQ#Is_there_a_diagram_of_the_system_catalogs_available

Thanks Thomas! I wasn't aware of that. I will point out (for others) that the
PNG is for v8.3, a bit old, but still a good start. I'll also point out that
the SVG link is broken.

> Neil Anderson wrote:
> Hi. I made some progress on this and I've added all the diagrams and
> documentation I've been able to produce so far for v10beta as well as
> the tools used here:

That's a great start, thanks! You should put a pointer to that page in the Pg wiki.

I think the 1 thing that would really help it though is to show the actual
connection/relations of the columns. For example, a line between pg_index
and pg_class is not quite as informative as a line from pg_index.indexrelid
to pg_class.oid (something the PNG file in the image that Thomas pointed
out does). I suspect that's a limitation of the tool not your desire.

Is this process automated, or does it require you to lay it out?

In my perfect world, :) there would be a way to generate it automatically with
Graphviz or something similar. Hmm, perhaps an idea to pursue when I can find
some time.

Kevin

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Klaus P. Pieper 2017-06-14 07:59:04 Re: pg_upgrade --link on Windows
Previous Message Bruce Momjian 2017-06-13 20:07:48 Re: [GENERAL] pg_upgrade --link on Windows