Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何在 PostgreSQL 中编写查询以连接到 Commnad Prompt?我想通过调用命令提示符在 PostgreSQL 查询本身中生成 GNUpg 中的密钥。是否有任何预定义的函数或过程,或者我们需要在 plpgsql 中编写函数?
通过使用 PL/sh 过程语言处理程序,我们可以将 postgresql 连接到 shell 提示符
PL/sh
简单的例子是
CREATE FUNCTION concat(text, text) RETURNS text AS $$ #!/bin/sh echo "$1$2" $$ LANGUAGE plsh;
-- 在此之前,任何其他语言都必须将 plsh 添加到工作数据库中,您可以使用检查语言是否已在数据库中
select * from pg_language;