긴 PL / pgSQL 코드 줄을 여러 줄로 나누려면 어떻게해야합니까?


16

긴 줄의 PL / pgSQL 코드를 여러 줄로 나누는 방법이 있습니까? 내 컨텍스트는 다음과 같이 테이블에 삽입을 로그하는 트리거 함수입니다.

INSERT INTO insert_log (log_time, description)
VALUES (
    now()
    , 'A description. Made up of 3 semi long sentences. That I want to split, in the code, not in the log table, over 3 lines for readability.'
);

2
PL / pgSQL이 아닌 일반 SQL입니다.
a_horse_with_no_name

도움이 필요한 청크 만 포함했으며 PL / pgSQL 함수의 일부입니다.
dw8547

답변:


23

문자열 상수는 매뉴얼에 설명 된대로 여러 줄로 나눌 수 있습니다

INSERT INTO insert_log (log_time, description)
VALUES (
    now()
    , 'A description. Made up of 3 semi long sentences. '
      'That I want to split, in the code, not in the log table, '
      'over 3 lines for readability.'
);
당사 사이트를 사용함과 동시에 당사의 쿠키 정책개인정보 보호정책을 읽고 이해하였음을 인정하는 것으로 간주합니다.
Licensed under cc by-sa 3.0 with attribution required.