Bug #78314 Register if a schema is a system schema or not
Submitted: 3 Sep 2015 8:01 Modified: 13 May 2017 10:19
Reporter: Daniël van Eeden (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Information schema Severity:S4 (Feature request)
Version:8.0 OS:Any
Assigned to: CPU Architecture:Any
Tags: information_schema, performance_schema, sys, system schema

[3 Sep 2015 8:01] Daniël van Eeden
Description:
Some tools like mysql{d,p}ump, enterprise backup and enterprise monitor, replication, mysql utilities as well as many external monitoring scripts (nagios etc) need to consider 'mysql', 'information_schema', 'performance_schema', 'sys', etc as special. This is now done with static checks against a list of known system schema's.

Also the list of system schema's has grown. It would be nice to be able to do something like this:
SHOW USER SCHEMAS -- no system tables, only user tables
SHOW SYSTEM SCHEMAS -- show only system tables

This is how PostgeSQL does it:
postgres=# \dn
    List of schemas
    Name     |  Owner   
-------------+----------
 public      | postgres
 testschema1 | postgres
(2 rows)

postgres=# \dnS
        List of schemas
        Name        |  Owner   
--------------------+----------
 information_schema | postgres
 pg_catalog         | postgres
 pg_temp_1          | postgres
 pg_toast           | postgres
 pg_toast_temp_1    | postgres
 public             | postgres
 testschema1        | postgres
(7 rows)

How to repeat:
See description
[11 Sep 2015 9:08] MySQL Verification Team
Hello Daniël,

Thank you for the feature request.

Thanks,
Umesh
[18 Jun 2016 21:27] Omer Barnir
Posted by developer:
 
Reported version value updated to reflect release name change from 5.8 to 8.0
[13 May 2017 10:19] Daniël van Eeden
I created a sys function as a possible solution:
https://github.com/mysql/mysql-sys/pull/111