What does def represent?

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: def 是代表的什么?

| username: 胡杨树旁

When querying information from the INFORMATION_SCHEMA.TABLES table, there is one column that I don’t quite understand the meaning of?

| username: Kongdom | Original post link

TABLE_CATALOG: The name of the catalog to which the table belongs. This value is always def.

| username: 胡杨树旁 | Original post link

Okay, thank you.

| username: ddhe9527 | Original post link

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

| username: 胡杨树旁 | Original post link

Okay, understood.

| username: 履霜知冰 | Original post link

This has always been def, even in MySQL, it doesn’t seem to be of much use.

| username: CuteRay | Original post link

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.

| username: 胡杨树旁 | Original post link

Okay, understood, thank you.

| username: system | Original post link

This topic will be automatically closed 60 days after the last reply. No new replies are allowed.