Re: review: CHECK FUNCTION statement

Pavel Stehule <pavel.stehule@gmail.com>

From: Pavel Stehule <pavel.stehule@gmail.com>
To: Alvaro Herrera <alvherre@commandprompt.com>
Cc: Petr Jelínek <pjmodos@pjmodos.net>, Greg Smith <greg@2ndquadrant.com>, Pg Hackers <pgsql-hackers@postgresql.org>, Albe Laurenz <laurenz.albe@wien.gv.at>
Date: 2012-03-05T13:49:01Z
Lists: pgsql-hackers

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Add const qualifiers to node inspection functions

Attachments

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