0

Tried to search what are Postgresql equivalent of MySQL's SHOW CREATE TABLE <TABLE-NAME> and SHOW CREATE DATABASE <DB-NAME>. Checking old Answer, it seems impossible. I would have given up if it wasn't for PgAdmin4 which shows them nicely which emboldened me for the search adventure.

So far it have been unsuccessful, with Google showing nothing useful and up-to-date on the issue. trying reading PgAdmin4 proved to be disastrous as I was lost in the code without any guide.

So my question is, is this possible yet? If no how does PgAdmin4 do, if any have an idea?

Note: My app is not allowed to modify the database and insert Function at all

1

You cannot do it in SQL, but you can use the pg_dump executable to get the complete table definition:

pg_dump --schema-only --table=tablename databasename

This won't work for databases, however.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.