Active discussions

postgresql 时间相关操作

疑似蜜糖 · 2026-07-30T08:52:22Z

今天遇到一个问题,就是其他业务系统过来的时间戳类型为毫秒级如:`1635830753393`通过postgresql 的`to_timestamp`函数后,发现时间错误了,得到的时间成为了 `53807-06-01 07:29:52.999936`经过排查发现时间戳位数问题,于是使用一下方式得到正确的时间 ```sql select to_timestamp(1635830753393/1000.0) //保留毫秒精度结果:2021-1

greenplum常用SQL

疑似蜜糖 · 2026-07-30T09:01:47Z

## 获取greenplum中的所有储存过程以及函数 ```SQL select n.nspname as schema_name, p.proname as procedure_name, p.prosrc as pro_src from pg_proc as p join pg_namespace as n on p.pronamespace = n.oid where n.nspname not like 'pg_%' and n