상세 컨텐츠

본문 제목

TIL - 230504

TIL

by 에스프리터 2023. 5. 4. 11:15

본문

728x90

AWS Redshift에서 url 디코딩 된 값을 보고 싶을 때

기본적으로 제공되는 건 없고 아래와 같이 함수를 생성해야 한다.

create function url_decode(text character varying) returns character varying
	immutable
	language plpythonu
as $$
    result = None
    if text is not None:
        import urllib
        result = urllib.unquote_plus(text)
    return result

$$;

아래와 같이 url_decode 함수를 사용하면 된다.

select url_decode(query) as url_decode, * from table;

AWS Redshift에서 사용자가 생성한 프로시저를 보고 싶을 때

아래와 같이 쿼리를 사용하여 확인할 수 있다.

SELECT
    n.nspname,
    b.usename,
    p.proname,
    p.prosrc
FROM
    pg_catalog.pg_namespace n
JOIN pg_catalog.pg_proc p ON
    pronamespace = n.oid
join pg_user b on
    b.usesysid = p.proowner
where
    nspname not in ('information_schema',
    'pg_catalog')

'TIL' 카테고리의 다른 글

TIL - 230427  (0) 2023.04.27
TIL - 230424  (0) 2023.04.24
TIL - 230421  (0) 2023.04.21
TIL - 230412  (0) 2023.04.12
TIL - 230410  (0) 2023.04.10
TIL - 230406  (0) 2023.04.06

태그

관련글 더보기

댓글 영역