Question

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

Était-ce utile?

La solution

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*.

Autres conseils

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.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top