【问题标题】:When trying to get the source of a function in Postgres using psql, what does the error "column p.proisagg does not exist" mean?尝试使用 psql 在 Postgres 中获取函数的来源时,错误“列 p.proisagg 不存在”是什么意思?
【发布时间】:2019-12-02 18:39:18
【问题描述】:

背景: 在 RDS 上使用 postgres 11,接口是 Centos 7 上的 psql;目标是显示某些存储过程/函数的来源,以便我可以使用它们

问题描述:当我尝试使用 \df+ 命令列出/显示给定存储函数的源时,我认为基于 [official docs here]( https://www.postgresql.org/docs/current/app-psql.html],报错如图:

psql=> \df+ schema_foo.proc_bar;
ERROR:  column p.proisagg does not exist
LINE 6:   WHEN p.proisagg THEN 'agg'

我不知道如何解释这个;有问题的函数不包含错误中显示的逻辑的 sn-p,也不包含 p.proisagg 中引用的列。我通过\ef在vim中打开函数验证了这一点。

我的猜测基于几个不相关的 github 问题,这些问题提到了同样的错误 for example 是它引用了 postgres 内部的一些模式代码。

总结:简而言之,我可以使用\ef查看函数的来源,所以从实际的角度来看,我的工作并没有受到影响,但是我想了解这个错误以及为什么我'我遇到了\df+

【问题讨论】:

  • 您正在使用过时的 psql 版本来对抗较新的 Postgres(服务器)版本
  • 成功了!非常感谢@a_horse_with_no_name。这让我遇到了另一个小困难,即无法弄清楚如何让 psql 作为版本 11 运行 [它安装在 centos 盒子和 rds 上,但 psql 符号链接由于某种原因已经过时并且不会'不通过 ln 手动更新] - 在这里解决了答案:stackoverflow.com/questions/34052046/…

标签: sql postgresql amazon-rds psql


【解决方案1】:

我遇到了同样的问题并运行了这两个命令来修复它

sed -i "s/NOT pp.proisagg/pp.prokind='f'/g" /usr/share/phpPgAdmin/classes/database/Postgres.php
sed -i "s/NOT p.proisagg/p.prokind='f'/g" /usr/share/phpPgAdmin/classes/database/Postgres.php

【讨论】:

    猜你喜欢
    • 2013-06-10
    • 1970-01-01
    • 1970-01-01
    • 2021-03-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-05-01
    • 2022-01-22
    相关资源
    最近更新 更多