Re: PostgreSQL Developer Best Practices

Поиск
Список
Период
Сортировка
От Melvin Davidson
Тема Re: PostgreSQL Developer Best Practices
Дата
Msg-id CANu8FixDct_-T6nNR7xd5hGwDMCAd47FjkFGafz06tMxd4-WTQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: PostgreSQL Developer Best Practices  (Karsten Hilbert <Karsten.Hilbert@gmx.net>)
Ответы Re: PostgreSQL Developer Best Practices
Список pgsql-general
>This is certainly not Best Practice as the warning is
>annoying for a reason.

>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.

>         Good example:
>         CREATE TABLE accounts
>         ( accout_id bigint NOT NULL ,

Typo.

So noted, I'll correct.

On Sat, Aug 22, 2015 at 11:46 AM, Karsten Hilbert <Karsten.Hilbert@gmx.net> wrote:
On Sat, Aug 22, 2015 at 11:15:07AM -0400, Melvin Davidson wrote:

> PostgreSQL Developer Best Practices
>
> 1. Prefix ALL literals with an Escape
>    EG:  SELECT E'This is a \'quoted literal \'';
>         SELECT E'This is an unquoted literal';
>
>    Doing so will prevent the annoying "WARNING:  nonstandard use of escape in a string literal"

This is certainly not Best Practice as the warning is
annoying for a reason.

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.

>         Good example:
>         CREATE TABLE accounts
>         ( accout_id bigint NOT NULL ,

Typo.

Karsten
--
GPG key ID E4071346 @ eu.pool.sks-keyservers.net
E167 67FD A291 2BEA 73BD  4537 78B9 A9F9 E407 1346


--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



--
Melvin Davidson
I reserve the right to fantasize.  Whether or not you
wish to share my fantasy is entirely up to you.

В списке pgsql-general по дате отправления:

Предыдущее
От: Karsten Hilbert
Дата:
Сообщение: Re: PostgreSQL Developer Best Practices
Следующее
От: Tom Lane
Дата:
Сообщение: Re: PostgreSQL Developer Best Practices