문제

The query:

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

returns

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.

I added explicit type casts like so:

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

still I get

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.

I'm using PostgreSql 9.3 JDBC driver connected to an Amazon RedShift instance

도움이 되었습니까?

해결책

Redshift doesn't have regexp_replace, it's cut down fork of an old PostgreSQL version with a bunch of added stuff.

See the Redshift documentation. See also \df pg_catalog.* or \df pg_catalog.*regexp*.

다른 팁

regexp_replace is one of many unsupported PostgreSQL functions in redshift.

One by one, those functions are added - take a look at a documentation history.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top