News for hackers. Stuff that matters.
Re:Features I'd Like in PostgreSQL by bornfreddy on Saturday January 28, 2023 @04:17PM (#34561986)
SHOW DATABASES; and SHOW TABLES;, please. DESC would be nice too. And let it work everywhere, not just in CLI (like \d & co. do).
Re:Features I'd Like in PostgreSQL by leo8 on Saturday January 28, 2023 @05:19PM (#34562598)
This a thousand times. I have to ALWAYS google that one big query for showing me all the databases. (I almost always connect with pgAdmin)
Re:Features I'd Like in PostgreSQL by deathanatos on Saturday January 28, 2023 @08:40PM (#34564021)
I'm confused; in what context are you always googling it? In pgAdmin, its displayed in the UI, no?

(I sort of agree with the parent, in that, if you need this in a raw SQL interface, it's a pain. But it shouldn't be a common pain point?)

[dead]
Re:Features I'd Like in PostgreSQL by deathanatos on Monday January 30, 2023 @07:57PM (#34589260)
Ah, another UI that hides information by default. Those are annoying.

(I'm a CLI user, so it's a \dt away. But I Googled screenshots of pgAdmin prior to commenting to see if it was in the UI, and it/was.)

Re:Features I'd Like in PostgreSQL by sroussey on Saturday January 28, 2023 @06:23PM (#34563062)
Also, MySQL's `show create table ...` would be great.
Re:Features I'd Like in PostgreSQL by drodgers on Saturday January 28, 2023 @08:20PM (#34563902)
I've never looked into this for Postgres itself, but AWS Redshift (a postgres derivative) has enough info in the system tables to reconstruct a create table statement using a view (see: https://raw.githubusercontent.com/awslabs/amazon-redshift-ut...) and I'd guess that you can do the same for Postgres.
Re:Features I'd Like in PostgreSQL by arp242 on Sunday January 29, 2023 @03:34PM (#34572428)
You can use "select * from pg_stat_user_tables" etc.

Admittedly the internal tables and views have a bit of a learning curve and are a little bit obscure (and inconsistent) at times, but it's much nicer and much more flexible.

The CLI stuff like \d are just "aliases" for queries; \set echo_hidden shows them.

Re:Features I'd Like in PostgreSQL by bornfreddy on Monday January 30, 2023 @11:38AM (#34582260)
Of course you can, but that is beside the point. Convenience matters - besides, these approaches can coexist, adding those simple queries (as aliases) should be trivial.
Re:Features I'd Like in PostgreSQL by arp242 on Monday January 30, 2023 @02:48PM (#34585402)
SHOW has well-defined consistent semantics. Adding "special shortcuts" doesn't seem like much of an improvement.

From the CLI \d etc. seems just as easy (easier actually), and you can add your own shortcuts if you want.

From outside the CLI, this sort of introspection is rare enough I don't really see the point in making special shortcuts for it.

Re:Features I'd Like in PostgreSQL by zX41ZdbW on Sunday January 29, 2023 @05:33PM (#34573482)
Although it has its gotchas, MySQL dialect is still somewhat better from the usability standpoint. "SHOW TABLES" is nice; it is natural and self-explanatory. "\d" is obscure.

It also reminds me how many DBMSs did not support the LIMIT clause because it is non-standard. But it is good from a usability perspective.

https://stackoverflow.com/questions/1528604/how-universal-is...

That's why ClickHouse has support for most of the extensions from the MySQL dialect.

Re:Features I'd Like in PostgreSQL by hholzgra on Monday January 30, 2023 @07:18AM (#34578720)
SHOW CREATE TABLE and friends even more so