Is there any direct method to compare tables between MySQL and PostgreSQL.Comparing should include field name, types, default values, etc; As an example below,
Below is a dump of PostgreSQL
column_name | data_type | is_nullable |
---|---|---|
service_id | integer | NO |
service_name | character varying | YES |
service_code | character varying | YES |
service_short_code | character varying | YES |
Below is a dump of MySQL
Field | Type | Null | Key | Default | Extra |
---|---|---|---|---|---|
service_id | int(11) | NO | PRI | NULL | auto_increment |
service_name | varchar(50) | NO | UNI | NULL | |
service_code | varchar(50) | NO | NULL | ||
service_desc | varchar(150) | NO | NULL |
from above example, need to get an output for in MySQL schema is missing'service_short_code' field and also it's type and if it's nullable, also 'service_desc' field not in PostgreSQL table and it's other data.
Will this be possible to do one time or any other way to do this other than copy and pasting this type of dumps in to excel file and mapping manually.
ORDER BY
when extracting, so that they will be in the "same" order.SHOW CREATE TAB:LE
; does Postgres have something similar?SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_name = 'name';