Re: newline conversion in SQL command strings

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: newline conversion in SQL command strings
Date: 2012-09-20 19:55:59
Message-ID: 505B74CF.2050208@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On 09/20/2012 03:34 PM, Tom Lane wrote:
> Andrew Dunstan <andrew(at)dunslane(dot)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

In response to

Browse pgsql-hackers by date

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