以下の内容はhttps://end0tknr.hateblo.jp/entry/20210131/1612066301より取得しました。


mysqlの"show create table" のpostgresにおける代替は、"pg_dump --schema-only"

以下の通り

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



以上の内容はhttps://end0tknr.hateblo.jp/entry/20210131/1612066301より取得しました。
このページはhttp://font.textar.tv/のウェブフォントを使用してます

不具合報告/要望等はこちらへお願いします。
モバイルやる夫Viewer Ver0.14