以下の通り
mysql> desc test_tbl; +-------+--------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-------+--------------+------+-----+---------+-------+ | id | int | NO | PRI | NULL | | | val | varchar(256) | YES | | NULL | | +-------+--------------+------+-----+---------+-------+ 2 rows in set (0.00 sec) mysql> show create table test_tbl; +----------+----------------------------------------------------------------------+ | Table | Create Table | +----------+----------------------------------------------------------------------+ | test_tbl | CREATE TABLE `test_tbl` ( | `id` int NOT NULL COMMENT 'これはtest_tbl.idのcomment', | `val` varchar(256) DEFAULT NULL, | PRIMARY KEY (`id`) | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci | COMMENT='これはtest_tblのcomment' | +----------+----------------------------------------------------------------------+
上記 mysqlの"show create table" のpostgresにおける代替は、以下。
$ /usr/bin/pg_dump -U postgres --dbname=db_rear_hon \ --schema-only --table=test_dbl
ちなみに、mysqlのmysqldumpでは、以下。
$ /usr/bin/mysqldump -u root -p test --no-data test_tbl