相关疑难解决方法(0)

从PostgreSQL数据库中检索注释

我正在Postgres数据库上运行一个项目,需要检索数据库中列的注释,以用作表格标题等.我已经看到有几个内置函数(pg_descriptioncol_description),但我无法找到如何使用它们的例子,并且使用它们已经证明是徒劳的.

所以我想知道是否有人能够做到这一点,如果是这样,怎么样?

postgresql metadata

29
推荐指数
8
解决办法
2万
查看次数

postgres中的动态sql查询

我试图使用动态SQL在postgres中运行一些查询.

例:

EXECUTE format('SELECT * from result_%s_table', quote_ident((select id from ids where condition = some_condition)))
Run Code Online (Sandbox Code Playgroud)

我必须查询一个表,其格式为result_%s_table,其中,我需要用另一个表替换正确的表名(一个id).

我收到了错误 ERROR: prepared statement "format" does not exist

链接:使用查询结果postgresql进行字符串替换

postgresql dynamic-sql psql

20
推荐指数
3
解决办法
5万
查看次数

在psql中定义多行字符串

我想粘贴

  123
  456
  789
Run Code Online (Sandbox Code Playgroud)

psql,并存储在一些可变多行字符串(即:str)以供以后使用.

那可能吗?现在我收到了unterminated quoted string错误.

postgresql console psql

9
推荐指数
1
解决办法
6480
查看次数

标签 统计

postgresql ×3

psql ×2

console ×1

dynamic-sql ×1

metadata ×1