28

Is there a way to split a long line of PL/pgSQL code over multiple lines? My context is a trigger function where I log inserts into a table as per:

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.'
);
dw8547
  • 947
  • 3
  • 11
  • 24

1 Answers1

43

String constants can be split over multiple lines as documented in the manual

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.'
);