3 ms·
I forget if there's an equivalent for the first one, but from psql there is a translation of mysql's "DESC table" as "\d table", and the rest are: \dt \l SEL
by Izkata 4y ago
I forget if there's an equivalent for the first one, but from psql there is a translation of mysql's "DESC table" as "\d table", and the rest are:
\dt
\l
SELECT * FROM pg_stat_activity;
- arp242 4y ago> 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.
- jhas78asd 4y agoFind the SQL from meta commands. Example: https://dba.stackexchange.com/a/131031 https://dba.stackexchange.com/a/131031
- arp242 4y agoThat is not equivalent to "show create table" at all.
- funcDropShadow 4y agoThere is an extension that does that: pgddl. [1] [1]: https://github.com/lacanoid/pgddl https://github.com/lacanoid/pgddl