From: | Robert Haas <robertmhaas(at)gmail(dot)com> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org, Marko Kreen <markokr(at)gmail(dot)com> |
Subject: | Re: Unicode string literals versus the world |
Date: | 2009-04-14 20:51:48 |
Message-ID: | 603c8f070904141351l4e16deb7vd1b165300aa7198f@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Tue, Apr 14, 2009 at 2:55 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Robert Haas <robertmhaas(at)gmail(dot)com> writes:
>> Well, that's fine, but that's a long way from Peter's statement that
>> "I think the tendency should be to get rid of E'' usage".
>
> Bear in mind that that's Peter's opinion; it's not necessarily shared
> by anyone else. I was just responding to your assertion of the
> diametrically opposed position that non-E strings are useless (which
> I don't share either).
Useless might be an overstatement, but I certainly have gotten no
benefit out of them. It seems decidedly odd to me to propose that
users embed literal control characters in their code/SQL scripts in
lieu of using escape sequences. If that were a normal and reasonable
thing to do then I expect C, C++, Perl, Python, Ruby, Javascript, and
countless other languages wouldn't provide this functionality. In
reality, most of them do provide it, sometimes as the only option.
And as to your point about Windows pathnames, if you're trying to
avoid escaping lots of backslashes, dollar-quoting is a perfectly
adequate solution.
The real motivation for standard_conforming_strings is the one
embedded in the name. And I'm fine with that. But I don't see E''
disappearing from my code any time soon. I periodically have a need
for things like foo || E'\n' || bar and it screws up the formatting of
the code to write foo || '
' || bar. Writing it that way, it's also entirely non-obvious whether
there are any spaces or tabs after the opening quote and before the
newline, and if so whether or not they are intentional. But I don't
mind if someone ELSE likes the new, standard strings - it just isn't
me. :-)
...Robert
From | Date | Subject | |
---|---|---|---|
Next Message | Robert Haas | 2009-04-14 20:56:56 | Re: Replacing plpgsql's lexer |
Previous Message | Sergey Burladyan | 2009-04-14 20:41:52 | Re: Solution of the file name problem of copy on windows. |