PostgreSQL 为什么不提供 SHOW CREATE TABLE ?

I know it seems dumb, but postgres really needs to add the simple developer experience stuff like: SHOW CREATE TABLE; SHOW TABLES; SHOW DATABASES; SHOW PROCESSLIST; CockroachDB added these aliases ages ago. 如上是 Hacker News 今年 5 月的一个帖子,相信 PostgreSQL 的用户都知道,PostgreSQL has its own way!!! 是的,我们用 slash commands,并且热衷这种简洁的方式: MySQL PG show create table t; \d+ t show tables; \d show tables like "%test%" \dt public.*test* show databases; \l show processlist; SELECT * from pg_stat_activity; 不过 slash commands 只能在 psql 中使用,psql 将相应的命令转换成对应的 SQL 查询发送到 server 端处理。大多情况下,这种方式能满足用户的需求,但也有例外,比如:...

November 26, 2023 · 1 min · 177 words · pg-x