我正在用Postgres编写我的第一个plperl函数,我需要访问current_settings()区域中的一些值(通过调用) --我想知道这样做的最佳解决方案是什么?
在plpgsql中,我可以执行如下操作:
DECLARE
cid int;
BEGIN
select nullif(current_setting('jwt.claims.customerId', true), '') :: int into cid;
END ...只是想知道在Perl plperl脚本中访问系统函数(如current_setting )的等效性。
谢谢!
发布于 2018-11-06 19:56:41
使用数据库访问功能之一,例如:
$rv = spi_exec_query("select nullif(current_setting('jwt.claims.customerId', true), '')::int as cid");
$cid = $rv->{rows}[0]->{cid};https://stackoverflow.com/questions/53178878
复制相似问题