Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.
Original topic: def 是代表的什么?
When querying information from the INFORMATION_SCHEMA.TABLES
table, there is one column that I don’t quite understand the meaning of?
TABLE_CATALOG: The name of the catalog to which the table belongs. This value is always def
.
First of all, this table is a compatibility table for MySQL under TiDB, and the fields are completely consistent with INFORMATION_SCHEMA.TABLES under MySQL. Secondly, this field is also mentioned in the MySQL documentation, referring to the catalog to which the table belongs, and is always ‘def’. This field has no substantial function in MySQL and is mainly to meet the SQL 92 standard. You can search for TABLE_CATALOG in SQL 92.
https://dev.mysql.com/doc/refman/5.7/en/information-schema-tables-table.html
http://www.contrib.andrew.cmu.edu/~shadow/sql/sql1992.txt
This has always been def, even in MySQL, it doesn’t seem to be of much use.
The concept of catalog comes from SQL 92. You can take a look at PostgreSQL, which has a clearer distinction between database, catalog, schema, and table. MySQL, including databases compatible with MySQL, simplifies these distinctions, making it less complex. The catalog is simplified, so in MySQL, the catalog for all tables is “def,” which is hardcoded in the code.
Okay, understood, thank you.
This topic will be automatically closed 60 days after the last reply. No new replies are allowed.