Re: PL/pgSQL 2

Поиск
Список
Период
Сортировка
От Jan Wieck
Тема Re: PL/pgSQL 2
Дата
Msg-id 540B403B.3020204@wi3ck.info
обсуждение исходный текст
Ответ на Re: PL/pgSQL 2  (David G Johnston <david.g.johnston@gmail.com>)
Список pgsql-hackers
On 09/06/2014 12:47 PM, David G Johnston wrote:
> ​If the language, and the system as a whole, was only used by
> perfectionists that do not make errors - and with perfectly clean data -
> this adherence to purity would be acceptable.  But the real world is not
> that clean and so enhancing the language to meet the needs of the real
> world is not crippling the language.  Begin able to state explicitly
> that the cardinality of the set I get back must be 1, no more and no
> less, doesn't remove the fact that I know I am dealing with a set and
> that I simply want to make an assertion as to its properties so that if
> a bug 3 layers deep into the application causes something other than 1
> row to be affected I know immediately and can invoke the appropriate
> action - throw an error.

As I already mentioned in the other thread, those assertions or checks 
do not belong into the PL. If they are desired they should be added to 
the main SQL syntax as COMMAND CONSTRAINT like suggested by Hannu.

Your statement is not limited to PL functions. It is just as valid for 
NORMAL applications.

However, this would be a proprietary extension that is not covered by 
any SQL standard and for that reason alone cannot be the default.


Regards,
Jan

-- 
Jan Wieck
Senior Software Engineer
http://slony.info



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

Предыдущее
От: David G Johnston
Дата:
Сообщение: Re: PL/pgSQL 2
Следующее
От: Petr Jelinek
Дата:
Сообщение: Re: proposal: plpgsql - Assert statement