Re: review: CHECK FUNCTION statement - Mailing list pgsql-hackers

From Pavel Stehule
Subject Re: review: CHECK FUNCTION statement
Date
Msg-id CAFj8pRDwFFfaihU6fdtZmQWTNBwNt6kvveW7CdqD_wFroHsg-Q@mail.gmail.com
Whole thread Raw
In response to Re: review: CHECK FUNCTION statement  (Alvaro Herrera <alvherre@commandprompt.com>)
Responses Re: review: CHECK FUNCTION statement  (Pavel Stehule <pavel.stehule@gmail.com>)
List pgsql-hackers
Hello

2012/3/5 Alvaro Herrera <alvherre@commandprompt.com>:
>
> Excerpts from Pavel Stehule's message of dom mar 04 16:33:08 -0300 2012:
>>
>> Hello
>>
>> 2012/3/4 Alvaro Herrera <alvherre@commandprompt.com>:
>
>> >                     CHECK FUNCTION
>> > ---------------------------------------------------------
>> >  In function: 'f()'
>> >  error:42P01:2:sentencia SQL:no existe la relación «foo»
>> >  query:select                                           +
>> >  var                                                    +
>> >  from                                                   +
>> >  foo
>> >                       ^
>> > (4 filas)
>> >
>>
>> this should be fixed. I checked expressions, that works (I expect)
>> correctly. Caret helps - (really). Sometimes man is blind :).
>
> Agreed.
>

I don't have your last version, so I am sending just part of
CheckFunctionById function - this fragment ensures a output

or please, send me your last patch and I'll do merge

now result is better

postgres=> create function f() returns int language plpgsql as $$
postgres$> begin select
postgres$> var
postgres$> from
postgres$> foo; end; $$;
CREATE FUNCTION
postgres=> check function f();
                      CHECK FUNCTION
-----------------------------------------------------------
 In function: f()
 error:42P01:2:SQL statement:relation "foo" does not exist
 query:select
       var
       from
       foo
       ^
(7 rows)

and some utf8 fce

postgres=> check function fx(int);
                  CHECK FUNCTION
--------------------------------------------------
 In function: fx(integer)
 error:42703:3:RETURN:column "ýšý" does not exist
 query:SELECT (select žlutý
             from jj
       /* ýšý */
       where /*ýšýšý8*/ ýšý = 10)
                        ^
(7 rows)

postgres=> check function fx(int);
                 CHECK FUNCTION
-------------------------------------------------
 In function: fx(integer)
 error:42703:3:RETURN:column "xx" does not exist
 query:SELECT (select t.a
             from t
       /* ýšý */
       where /*ýšýšý8*/ xx = 10)
                        ^
(7 rows)

caret is ok

regards

Pavel

> --
> Álvaro Herrera <alvherre@commandprompt.com>
> The PostgreSQL Company - Command Prompt, Inc.
> PostgreSQL Replication, Consulting, Custom Development, 24x7 support

Attachment

pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: Re: pg_stat_statements normalisation without invasive changes to the parser (was: Next steps on pg_stat_statements normalisation)
Next
From: Alexander Korotkov
Date:
Subject: Re: Collect frequency statistics for arrays