1--
2-- Universal Newline Support
3--
4CREATE OR REPLACE FUNCTION newline_lf() RETURNS integer AS
5E'x = 100\ny = 23\nreturn x + y\n'
6LANGUAGE plpythonu;
7CREATE OR REPLACE FUNCTION newline_cr() RETURNS integer AS
8E'x = 100\ry = 23\rreturn x + y\r'
9LANGUAGE plpythonu;
10CREATE OR REPLACE FUNCTION newline_crlf() RETURNS integer AS
11E'x = 100\r\ny = 23\r\nreturn x + y\r\n'
12LANGUAGE plpythonu;
13SELECT newline_lf();
14 newline_lf
15------------
16        123
17(1 row)
18
19SELECT newline_cr();
20 newline_cr
21------------
22        123
23(1 row)
24
25SELECT newline_crlf();
26 newline_crlf
27--------------
28          123
29(1 row)
30
31