gpt4 book ai didi

postgresql - `select regexp_replace(, '\s+ ', ' ')` 想要显式类型转换,但是怎么做?

转载 作者:行者123 更新时间:2023-11-29 14:07:20 25 4
gpt4 key购买 nike

查询:

update enquiry_address_data  
set address_line_1 = upper(regexp_replace(btrim(address_line_1), '\s+', ' '));

返回

ERROR: function regexp_replace(text, "unknown", "unknown") does not exist
Hint: No function matches the given name and argument types. You may need to add explicit type casts.

我像这样添加了显式类型转换:

update enquiry_address_data  
set address_line_1 = upper(regexp_replace(btrim(address_line_1), '\s+' :: text, ' ' :: text));

我还是明白了

ERROR: function regexp_replace(text, character varying, character varying) does not exist
Hint: No function matches the given name and argument types. You may need to add explicit type casts.

我正在使用连接到 Amazon RedShift 实例的 PostgreSql 9.3 JDBC 驱动程序

最佳答案

Redshift 没有 regexp_replace,它是旧 PostgreSQL 版本的分支,添加了一堆东西。

请参阅 Redshift 文档。另请参阅 \df pg_catalog.*\df pg_catalog.*regexp*

关于postgresql - `select regexp_replace(<column>, '\s+ ', ' ')` 想要显式类型转换,但是怎么做?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21702268/

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