Re: [HACKERS] merging some features from plpgsql2 project

Поиск
Список
Период
Сортировка
От Marko Tiikkaja
Тема Re: [HACKERS] merging some features from plpgsql2 project
Дата
Msg-id CAL9smLCmHCJBuH+2FMcZMb_yjTMf6s7gaEhtV6VW9aoQWzBwTg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [HACKERS] merging some features from plpgsql2 project  (Jim Nasby <Jim.Nasby@BlueTreble.com>)
Ответы Re: [HACKERS] merging some features from plpgsql2 project  (Jim Nasby <Jim.Nasby@BlueTreble.com>)
Список pgsql-hackers
On Mon, Jan 9, 2017 at 12:37 AM, Jim Nasby <Jim.Nasby@bluetreble.com> wrote:
If we're going to create a brand new language then I think it would be extremely foolish to keep *any* of the current pain points around. Off the top of my head:

- variables must have an identifier (what $ in most languages does). The steps you have to go through to avoid simple naming collisions are insane.

This is exactly what we did not want to do with this project.  The idea is to create a language which is really close to PL/PgSQL, but removes some of the brain diarrhoea currently present.

Now, this *is* a problem, and the solution we had (well I, mostly, at this point) in mind is to use the underscore prefix for all input variables and make OUT parameters invisible to queries inside function bodies unless explicitly prefixed with   OUT.  As far as I can tell this eliminates most if not all collisions while staying almost completely compatible with arguably well-written PL/PgSQL 1.

- Support for the notion of a variable being unset (which is NOT the same thing as NULL).

My idea was that the currently unsupported combination of NOT NULL and no DEFAULT would mean "has to be assigned to a non-NULL value before it can be read from, or an exception is thrown".  Solves the most common use case and is backwards compatible.


.m

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

Предыдущее
От: Merlin Moncure
Дата:
Сообщение: Re: [HACKERS] merging some features from plpgsql2 project
Следующее
От: Andrew Dunstan
Дата:
Сообщение: Re: [HACKERS] merging some features from plpgsql2 project