Re: review: CHECK FUNCTION statement

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: Petr Jelínek <pjmodos(at)pjmodos(dot)net>, Greg Smith <greg(at)2ndquadrant(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>, Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>
Subject: Re: review: CHECK FUNCTION statement
Date: 2012-03-05 13:49:01
Message-ID: CAFj8pRDwFFfaihU6fdtZmQWTNBwNt6kvveW7CdqD_wFroHsg-Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello

2012/3/5 Alvaro Herrera <alvherre(at)commandprompt(dot)com>:
>
> Excerpts from Pavel Stehule's message of dom mar 04 16:33:08 -0300 2012:
>>
>> Hello
>>
>> 2012/3/4 Alvaro Herrera <alvherre(at)commandprompt(dot)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(at)commandprompt(dot)com>
> The PostgreSQL Company - Command Prompt, Inc.
> PostgreSQL Replication, Consulting, Custom Development, 24x7 support

Attachment Content-Type Size
patch.c text/x-csrc 2.8 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alexander Korotkov 2012-03-05 14:02:24 Re: Collect frequency statistics for arrays
Previous Message Andrew Dunstan 2012-03-05 13:24:28 Re: Re: pg_stat_statements normalisation without invasive changes to the parser (was: Next steps on pg_stat_statements normalisation)