Re: PL/pgSQL 1.2

Поиск
Список
Период
Сортировка
От Joel Jacobson
Тема Re: PL/pgSQL 1.2
Дата
Msg-id CAASwCXdnm68YMbS7SXi1QXGEgXH0Nbo-bZm5k9xRka2FSVP2wA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: PL/pgSQL 1.2  (Hannu Krosing <hannu@2ndQuadrant.com>)
Ответы Re: PL/pgSQL 1.2  (Pavel Stehule <pavel.stehule@gmail.com>)
Список pgsql-hackers
On Wed, Sep 3, 2014 at 11:19 PM, Hannu Krosing <hannu@2ndquadrant.com> wrote:
> SELECT[1]   - select exactly one row, anything else raises error
> SELECT[0:1]   - select zero or one rows, anything else raises error
> SELECT[1:] - select one or more rows
>
> plain SELECT is equivalent to SELECT[0:]
>
> same syntax could be used for enforcing sane affected row counts
> for INSERT and DELETE

+1 for a new fresh creative idea! My mind was stuck in a "looking for
keywords" state.

The only suggestion I think is slightly better is the "STRICT UPDATE",
but only if I'm right assuming the "one row" use-case is much more
common than the "zero or one rows" and "one or more rows" use-cases.

If all use-cases are equally important to support in a nice way,
then the suggested syntax is brilliant, as it supports all of them.

Bonus points for the extremely condensed syntax.

> 2. Substitute for EXECUTE with string manipulation
> ----------------------------------------------------------------
>
> using backticks `` for value/command substitution in SQL as an alternative
> to EXECUTE string

+1 for being backwards compatible, but I have no strong opinion.

> 3. A way to tell pl/pggsql not to cache plans fro normal queries
> -----------------------------------------------------------------------------------

> OR we could do it in SQL-ish way using like this:
>
> SELECT
> ...
> USING FRESH PLAN;

+1 for clean syntax



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

Предыдущее
От: Alexey Klyukin
Дата:
Сообщение: Re: implement subject alternative names support for SSL connections
Следующее
От: Pavel Stehule
Дата:
Сообщение: Re: PL/pgSQL 1.2