2014-02-11 1 views
0

쿼리 : 내가 명시 적 유형을 추가 `select regexp_replace (<column>, ' 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+', ' ')); 

반환

은과 같이 캐스트 :
update enquiry_address_data 
set address_line_1 = upper(regexp_replace(btrim(address_line_1), '\s+' :: text, ' ' :: text)); 

여전히 내가 PostgreSQL을 사용하고

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. 

를 얻을 수

9. 3 Amazon RedShift 인스턴스에 연결된 JDBC 드라이버

답변

3

Redshift에는 regexp_replace이 없으므로 추가 PostgreSQL 버전의 포크가 추가되었습니다.

Redshift 설명서를 참조하십시오. \df pg_catalog.* 또는 \df pg_catalog.*regexp*을 참조하십시오.

2

regexp_replace은 redshift에서 많은 unsupported PostgreSQL functions 중 하나입니다.

하나씩 차례로 기능이 추가되었습니다. documentation history을 살펴보십시오.

+0

아마존이 Redshift/ParAccel 및 Amazon AWS 관련 변경 사항 중 일부를 메인 라인 Pg에 대한 패치로 다시 제공하면 좋을 것입니다. –