Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> I forget if there's an equivalent for the first one

Not really; PostgreSQL doesn't store the original query, so you'll need to re-create it from pg_class, pg_attribute, and all of that (which is really what \d and such in psql do). The easiest way is probably pg_dump, but it's best to just get used to \-commands because it's really just the same thing.



Find the SQL from meta commands. Example: https://dba.stackexchange.com/a/131031


That is not equivalent to "show create table" at all.


There is an extension that does that: pgddl. [1]

[1]: https://github.com/lacanoid/pgddl




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: