Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1eljpT-0004es-GJ for pgsql-general@arkaria.postgresql.org; Tue, 13 Feb 2018 23:17:39 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eljpS-0004B8-DO for pgsql-general@arkaria.postgresql.org; Tue, 13 Feb 2018 23:17:38 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eljpS-0004Az-2h for pgsql-general@lists.postgresql.org; Tue, 13 Feb 2018 23:17:38 +0000 Received: from mail.hjp.at ([212.17.106.138] helo=rorschach.hjp.at) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1eljpP-00006d-5T for pgsql-general@lists.postgresql.org; Tue, 13 Feb 2018 23:17:36 +0000 Received: by rorschach.hjp.at (Postfix, from userid 1000) id 183D51629; Wed, 14 Feb 2018 00:17:31 +0100 (CET) Date: Wed, 14 Feb 2018 00:17:31 +0100 From: "Peter J. Holzer" To: pgsql-general@lists.postgresql.org Subject: Re: I do not get the point of the information_schema Message-ID: <20180213231731.oatjdd352j6dju4r@hjp.at> References: <303d3d2c-ef0b-af0a-e4d1-4b17a029fc0f@gelassene-pferde.biz> <20180213225755.hbpadizwav3ma2kn@hjp.at> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="jaci4f3hwmsem5fq" Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --jaci4f3hwmsem5fq Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2018-02-13 16:06:43 -0700, David G. Johnston wrote: > On Tue, Feb 13, 2018 at 3:57 PM, Peter J. Holzer wrote: >=20 > (That said, it looks like both PostgreSQL and MariaDB include additio= nal > columns beyond those mandated by the standard - you can't rely on tho= se, > of course. And some databases like Oracle don't even have an informat= ion > schema.) >=20 >=20 > Given the documented charter of information_schema I'd present your concl= usion > and evidence to pgsql-bugs...while I suppose extra columns are not inhere= ntly > 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=3D> select * from information_schema.tables where table_type=3D'BASE TA= BLE' limit 1; =E2=94=80[ RECORD 1 ]=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=AC=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80 table_catalog =E2=94=82 hjp table_schema =E2=94=82 public table_name =E2=94=82 hjpnet table_type =E2=94=82 BASE TABLE self_referencing_column_name =E2=94=82 (=E2=88=85) reference_generation =E2=94=82 (=E2=88=85) user_defined_type_catalog =E2=94=82 (=E2=88=85) user_defined_type_schema =E2=94=82 (=E2=88=85) user_defined_type_name =E2=94=82 (=E2=88=85) is_insertable_into =E2=94=82 YES is_typed =E2=94=82 NO commit_action =E2=94=82 (=E2=88=85) MariaDB [simba]> select * from information_schema.tables where table_type= =3D'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:=20 TABLE_COMMENT:=20 1 row in set (0.01 sec) The first 4 are the same, all others are different.=20 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 --=20 _ | 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 --jaci4f3hwmsem5fq Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEETtJbRjyPwVTYGJ5k8g5IURL+KF0FAlqDcgYACgkQ8g5IURL+ KF3Y4Q/8C0sewYC1fpbXH93nnftACcASl2gtmGMafEvqIpONqsH+i2+XXjohSXl1 73V8y/Z3ddcx7nedVB38UU38v4gjY27l1Xi9O//SWnhUADPsP18HUBTh+zZRYYA6 7p3xeynL4YnRNkXt2ISYWavRmDaHQ34lelTfjlmb7Nh9SlXGR+gK5uE6jMlyE5p4 qLOLZbHD1KJPdEcF3HSO0G4CcFsqV4xoL+dPECRCut9N7ZE0bA4IJnzV2F8GN7WH l1pxPb4jkB5q46i4J/9ZVC+BZsMTGVV2MiXZJJxzq+xgOHJW0RuiALztfj5Xp8kA VCVcuT7gy0noOqy8Xvzh4EMsW1wKso88h2DTW4nAETZh8Uc1vzA/LBE48/QLwviC /x8sGfmabLEa2p9BDJ8g9z/S0OWXdbTMtQAtCbe0Vh8Gr8wTBM0FJt3fS0gsgm5E iglpoZ9IlrFO9vkD21AybJGzkfB68sqfueT+3MyTclkWD/JU+294nyWT4RVY1+wP vDU1YufU/0/insTEOPwL2ypfvd44caP4mDpd10A1DVGsX1KpYCzFCjUghvJGsNt+ RGy6tns13uXP0PS4Yb45swGyqe3iqbdLLCXhBrUVSzavypgy78iXF12bu/o2tWYH pbK9+sddjiubWeYIAq/umFuxYQLVg545jjgwbyLqRZrXQOTOMgc= =wx70 -----END PGP SIGNATURE----- --jaci4f3hwmsem5fq--