PostgreSQL 作为当下流行的数据库,不少开发者因其开源、可靠、可扩展等特性把它应用到实际的生产环境中,帮助无数 PostgreSQL 厂商的 Percona 编制了一个最常见错误的列表。即使你认为自己已经正确地安装配置 PostgreSQL,或许仍会发现此列表对于验证你的安装配置大有裨益。
原文链接:
https://www.infoworld.com/article/3681655/10-common-postgresql-mistakes-and-how-to-avoid-them.html
SELECT name, setting, boot_val
FROM pg_settings
WHERE context = 'postmaster';
SELECT name
, short_desc
, setting
, unit
, CASE
WHEN context = 'postmaster' THEN 'restart'
WHEN context = 'sighup' THEN 'reload'
ELSE context
END "server requires"
FROM pg_settings
WHERE name LIKE '%vacuum%';
backend_start | 2022-10-25 09:25:07.934633+00
xact_start | 2022-10-25 09:25:11.238065+00
query_start | 2022-10-25 09:25:11.238065+00
state_change | 2022-10-25 09:25:11.238381+00
wait_event_type | Client
wait_event | ClientRead
state | idle in transaction
SELECT gid
, prepared
, REGEXP_REPLACE(gid, '.* ', '') AS age
FROM pg_prepared_xacts
WHERE prepared + CAST(regexp_replace(gid, '.* ', '') AS INTERVAL) < NOW();
SELECT * FROM pg_extension;
SELECT * FROM pg_available_extensions();
SELECT * FROM pg_available_extension_versions();
如果字段的最大可能长度超过255字节,那么长度值可能…
只能说作者太用心了,优秀
感谢详解
一般干个7-8年(即30岁左右),能做到年入40w-50w;有…
230721