Re: poll: CHECK TRIGGER?

Поиск
Список
Период
Сортировка
От Petr Jelinek
Тема Re: poll: CHECK TRIGGER?
Дата
Msg-id 4F589846.70303@pjmodos.net
обсуждение исходный текст
Ответ на Re: poll: CHECK TRIGGER?  (Pavel Stehule <pavel.stehule@gmail.com>)
Список pgsql-hackers
On 03/08/2012 08:35 AM, Pavel Stehule wrote:
> Here is updated patch (with regress tests, with documentation).
>
> I removed a CHECK FUNCTION and CHECK TRIGGER statements and replaced
> it by pg_check_function and pg_check_trigger like Tom proposed.
>
> The core of this patch is same - plpgsql checker, only user interface
> was reduced.
>
> postgres=>  select pg_check_function('f2()');
>                         pg_check_function
> ---------------------------------------------------------------
>   error:42703:3:RETURN:column "missing_variable" does not exist
>   Query: SELECT 'Hello' || missing_variable
>   --                       ^
> (3 rows)
>
> postgres=>  select pg_check_trigger('t','t1');
>                      pg_check_trigger
> --------------------------------------------------------
>   error:42703:3:assignment:record "new" has no field "b"
>   Context: SQL statement "SELECT new.b + 1"
> (2 rows)
>

I did rereview and rechecked with few dozen of real-world functions, and
it still looks good from my point of view. I made bit of adjustment of
english in new comments and Pavel sent me privately fix for proper
handling of languages that don't have checker function. Updated patch
attached.

Regards
Petr Jelinek


Вложения

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

Предыдущее
От: Thom Brown
Дата:
Сообщение: Re: pg_basebackup streaming issue from standby
Следующее
От: Alvaro Herrera
Дата:
Сообщение: check function patch