Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.schema for postgres

I'm migrating a database from sqlite3 to postgres and am wondering if there are any short tutorials that can teach me the new syntax.

Also, as a short term question, how do I see the schema of a postgres table which is equivalent to .schema in sqlite?

like image 473
locoboy Avatar asked Sep 15 '26 17:09

locoboy


1 Answers

You could use pg_dump command line utility, i.e.:

pg_dump --table <table_name> --schema-only <database_name>

Depending on your environment you probably need to specify connection options (-h, -p, -U switches).

like image 118
dmirkitanov Avatar answered Sep 18 '26 17:09

dmirkitanov



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!