Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Bringing psql's \d to your web browser (neon.tech)
9 points by gmac on April 17, 2024 | hide | past | favorite | 2 comments


Postgres \ commands are incredible shortcuts that are a pain to write in sql. E.g.

\dt+ translates to

SELECT schemaname, tablename, tableowner, tablespace, pg_size_pretty(pg_total_relation_size(quote_ident(schemaname) || '.' || quote_ident(tablename))) AS total_size FROM pg_tables ORDER BY pg_total_relation_size(quote_ident(schemaname) || '.' || quote_ident(tablename)) DESC;


I wrote this post (and the npm packages it describes). Happy to answer questions.




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

Search: