Re: PostgreSQL Developer Best Practices

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Melvin Davidson <melvin6925(at)gmail(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: PostgreSQL Developer Best Practices
Date: 2015-08-22 17:16:02
Message-ID: 20526.1440263762@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Melvin Davidson <melvin6925(at)gmail(dot)com> writes:
>> Best Practice would rather be something along the lines:
>>>> Avoid coding in a way that triggers "WARNING:
>>>> nonstandard use of escape in a string literal". If you
>>>> cannot comply with this rule document your reasons.

> Thanks for the suggestion. For the past few months I've been dealing with
> an error log that is filled with these warnings simply because
> the developers do not comprehend how to use ( or the requirement to use)
> an escape clause.

IMO best practice in this area is "run with standard_conforming_strings = ON".
If you're seeing this warning at all, it's because you aren't doing that,
which means your code is unnecessarily unportable to other DBMSes.
Adopting a coding policy of always using E'' would make that worse.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Igor Sosa Mayor 2015-08-22 17:16:17 Re: Problem with pl/python procedure connecting to the internet
Previous Message Melvin Davidson 2015-08-22 16:02:56 Re: PostgreSQL Developer Best Practices