Re: newline conversion in SQL command strings - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: newline conversion in SQL command strings
Date
Msg-id 505B74CF.2050208@dunslane.net
Whole thread Raw
In response to Re: newline conversion in SQL command strings  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On 09/20/2012 03:34 PM, Tom Lane wrote:
> Andrew Dunstan <andrew@dunslane.net> writes:
>> On 09/20/2012 09:12 AM, Peter Eisentraut wrote:
>>> It has been proposed that the plsh handler should strip the CRs before
>>> execution.  But I don't think that is a correct solution, because that
>>> is user data which could be relevant.  It could be the case, for
>>> example, that plsh is run on a Windows host with a particular shell that
>>> requires CRLF line endings.
>> I confess I find it hard to take plsh terribly seriously,
> Perhaps, but the general problem remains, for any language whose
> interpreter is unforgiving about line endings.


plsh is the only one I know of that writes the script out to a temp 
file, and it opens that file on Windows in text mode (if I'm looking at 
the right source), which will convert LF into CRLF. Hence my suggestion 
that he change that. Of course, if the function body actually has 
embedded CRs then there is a different set of problems.

cheers

andrew






pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: ToDo: allow to get a number of processed rows by COPY statement [Review of Patch]
Next
From: Tom Lane
Date:
Subject: Re: Re: proposal and patch : support INSERT INTO...RETURNING with partitioned table using rule