Re: [GENERAL] pg_catalog tables don't have constraints? - Mailing list pgsql-general

From
Subject Re: [GENERAL] pg_catalog tables don't have constraints?
Date
Msg-id 20170613152444.677A1521@m0117565.ppops.net
Whole thread Raw
In response to [GENERAL] pg_catalog tables don't have constraints?  (Neil Anderson <neil@postgrescompare.com>)
Responses Re: [GENERAL] pg_catalog tables don't have constraints?
List pgsql-general
Thomas Kellerer wrote:
> kbrannen@pwhome.com schrieb am 09.06.2017 um 20:57:
> > Neil Anderson <neil@postgrescompare.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


pgsql-general by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [GENERAL] pg_upgrade --link on Windows
Next
From: "Klaus P. Pieper"
Date:
Subject: Re: [GENERAL] pg_upgrade --link on Windows