pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter J. Holzer <hjp-pgsql@hjp.at>
To: pgsql-general@lists.postgresql.org
Subject: Re: I do not get the point of the information_schema
Date: Wed, 14 Feb 2018 00:17:31 +0100
Message-ID: <20180213231731.oatjdd352j6dju4r@hjp.at> (raw)
In-Reply-To: <CAKFQuwbXbq73==e18A2JcNX9Nii3y4ywMW-s2-69Pfrwt3FeUQ@mail.gmail.com>
References: <303d3d2c-ef0b-af0a-e4d1-4b17a029fc0f@gelassene-pferde.biz>
	<20180213225755.hbpadizwav3ma2kn@hjp.at>
	<CAKFQuwbXbq73==e18A2JcNX9Nii3y4ywMW-s2-69Pfrwt3FeUQ@mail.gmail.com>

On 2018-02-13 16:06:43 -0700, David G. Johnston wrote:
> On Tue, Feb 13, 2018 at 3:57 PM, Peter J. Holzer <hjp-pgsql@hjp.at> wrote:
> 
>     (That said, it looks like both PostgreSQL and MariaDB include additional
>     columns beyond those mandated by the standard - you can't rely on those,
>     of course. And some databases like Oracle don't even have an information
>     schema.)
> 
> 
> Given the documented charter of information_schema I'd present your conclusion
> and evidence to pgsql-bugs...while I suppose extra columns are not inherently
> harmful at minimum they would need to be documented if kept.

I don't have evidence, as I don't have access to a recent SQL standard.
But I noticed that for example information_schema.tables have only a few
columns in common between PostgreSQL and MariaDB:

hjp=> select * from information_schema.tables where table_type='BASE TABLE' limit 1;
─[ RECORD 1 ]────────────────┬───────────
table_catalog                │ hjp
table_schema                 │ public
table_name                   │ hjpnet
table_type                   │ BASE TABLE
self_referencing_column_name │ (∅)
reference_generation         │ (∅)
user_defined_type_catalog    │ (∅)
user_defined_type_schema     │ (∅)
user_defined_type_name       │ (∅)
is_insertable_into           │ YES
is_typed                     │ NO
commit_action                │ (∅)

MariaDB [simba]> select * from information_schema.tables where table_type='BASE TABLE' limit 1\G
*************************** 1. row ***************************
  TABLE_CATALOG: def
   TABLE_SCHEMA: simba
     TABLE_NAME: archived_versions
     TABLE_TYPE: BASE TABLE
         ENGINE: MyISAM
        VERSION: 10
     ROW_FORMAT: Fixed
     TABLE_ROWS: 0
 AVG_ROW_LENGTH: 0
    DATA_LENGTH: 0
MAX_DATA_LENGTH: 7036874417766399
   INDEX_LENGTH: 1024
      DATA_FREE: 0
 AUTO_INCREMENT: 1
    CREATE_TIME: 2008-01-28 01:24:48
    UPDATE_TIME: 2008-01-28 01:24:48
     CHECK_TIME: NULL
TABLE_COLLATION: utf8_general_ci
       CHECKSUM: NULL
 CREATE_OPTIONS: 
  TABLE_COMMENT: 
1 row in set (0.01 sec)

The first 4 are the same, all others are different. 
It is possible that all the columns that PostgreSQL has are required by
the standard and that MariaDB is non-conforming by omitting them, but at
least some of the names look quite PostgreSQL-specific to me. So my
guess is that the standard only requires the first 4 and the rest are
RDBMS-specific.

        hp

-- 
   _  | Peter J. Holzer    | we build much bigger, better disasters now
|_|_) |                    | because we have much more sophisticated
| |   | hjp@hjp.at         | management tools.
__/   | http://www.hjp.at/ | -- Ross Anderson <https://www.edge.org/;

Attachments:

  signature.asc (application/pgp-signature, 832B) download

view thread (8+ messages)  latest in thread

Message-ID: <20180213231731.oatjdd352j6dju4r@hjp.at>
Permalink:  ../20180213231731.oatjdd352j6dju4r@hjp.at/
Also on:    postgresql.org/message-id/20180213231731.oatjdd352j6dju4r@hjp.at

 · 

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: hjp-pgsql@hjp.at
  Subject: Re: I do not get the point of the information_schema
  In-Reply-To: <20180213231731.oatjdd352j6dju4r@hjp.at>
  References: <303d3d2c-ef0b-af0a-e4d1-4b17a029fc0f@gelassene-pferde.biz> <20180213225755.hbpadizwav3ma2kn@hjp.at> <CAKFQuwbXbq73==e18A2JcNX9Nii3y4ywMW-s2-69Pfrwt3FeUQ@mail.gmail.com> <20180213231731.oatjdd352j6dju4r@hjp.at>

* 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