pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Martin Mueller <martinmueller@northwestern.edu>
Cc: Andreas Joseph Krogh <andreas@visena.com>
Cc: Chris Travers <chris.travers@gmail.com>
Cc: pgsql-generallists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: Oracle vs. PostgreSQL - a comment on Mysql
Date: Wed, 3 Jun 2020 18:32:14 -0400
Message-ID: <20200603223214.GA12556@alvherre.pgsql> (raw)
In-Reply-To: <3A33195B-6B00-4C89-BFBE-1E43C5F07FDB@northwestern.edu>

On 2020-Jun-03, Martin Mueller wrote:

> On the topic of what other databases do better: I much prefer Postgres to Mysql because it has better string functions and better as well as very courteous error messages. But MySQL has one feature that sometimes makes me want to return it: it stores the most important metadata about tables in a Mysql table that can be queried as if it were just another table.  That is a really feature. I makes it very easy to look for a table that you edited most recently, including a lot of other things.
> 
> Why doesn’t Postgres have that feature? Or is there a different and equally easy way of getting at these things that I am just missing?

Every little schema detail in Postgres is in a catalog table that you
can query.  See pg_class for a list of relations; pg_attribute for
attributes; and so on.  You can learn a lot about them just by running
"psql -E" and executing \d -- look at the queries that appear above the
resultset.  We even have a whole section in our docs about the layout of
the system catalogs.  Also, there are views that make the whole thing
easier.  See https://www.postgresql.org/docs/devel/catalogs.html

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services





view thread (4+ messages)  latest in thread

Message-ID: <20200603223214.GA12556@alvherre.pgsql>
Permalink:  ../20200603223214.GA12556@alvherre.pgsql/
Also on:    postgresql.org/message-id/20200603223214.GA12556@alvherre.pgsql

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: alvherre@2ndquadrant.com, martinmueller@northwestern.edu, andreas@visena.com, chris.travers@gmail.com
  Subject: Re: Oracle vs. PostgreSQL - a comment on Mysql
  In-Reply-To: <20200603223214.GA12556@alvherre.pgsql>
  References: <3A33195B-6B00-4C89-BFBE-1E43C5F07FDB@northwestern.edu> <20200603223214.GA12556@alvherre.pgsql>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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