gpt4 book ai didi

postgresql - Hstore 作为 postgresql 中的参数类型

转载 作者:行者123 更新时间:2023-11-29 12:21:40 26 4
gpt4 key购买 nike

在 postgresql 中创建函数时是否可以将 hstore 声明为参数类型?

CREATE FUNCTION samplehstore(uname hstore)
RETURNS SETOF void AS
DECLARE
BEGIN
RAISE NOTICE 'uname : %', uname ;
END;
LANGUAGE plpgsql

最佳答案

是的。刚刚测试:

create or replace function samplehstore(_h hstore)
returns text as
$$
begin
return _h->'a';
end
$$
language plpgsql;

select samplehstore('a=>1'::hstore)
>>> 1

关于postgresql - Hstore 作为 postgresql 中的参数类型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18800291/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com