Search Postgresql Archives

Re: PostgreSQL Developer Best Practices

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Saturday, August 22, 2015, Melvin Davidson <melvin6925@xxxxxxxxx> wrote:
>The correct way to escape a quote is to double quote it:  'Mr. M''vey'

That is a matter of opinion. However, the real problem is the enclosed backslashes, which is
beyond our control at this point. Therefore, the best solution is to use ESCAPE E.


Why is this a best practice and not just "how things work"?  If you want to use backlash escapes you use E''.  If you don't use a backslash escape it doesn't matter - except if you are writing a backslash and don't want to have to escape it.

Beyond that turn your idea of best practice into a requirement and enable standard-conforming-strings.

Always using E'' is pragmatic advice but hardly worthy of being considered best practice.  The best practice is to write code in such a way that you can leave standard conforming strings off AND not generate any warnings.

David J.



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux