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-04 19:33:08
Message-ID: CAFj8pRBn12rVL=tgZnT4LgzC8BWH5E4jqMAXsO2zdV5Oysxv1Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello

2012/3/4 Alvaro Herrera <alvherre(at)commandprompt(dot)com>:
>
> Excerpts from Alvaro Herrera's message of sáb mar 03 17:56:23 -0300 2012:
>> Excerpts from Alvaro Herrera's message of sáb mar 03 16:54:19 -0300 2012:
>> > Excerpts from Pavel Stehule's message of sáb mar 03 02:25:52 -0300 2012:
>>
>> > > 3. THE ARE NOT CARET - this is really important
>>
>> > I am not sure about the caret thingy -- mainly because I don't think it
>> > works all that well.
>
> It doesn't work correctly with your patch; see sample below.  Note the
> caret is pointing to an entirely nonsensical position.  I'm not sure
> about duplicating the libpq line-counting logic in the backend.
>
> Also note i18n seems to be working well, except for the "In function"
> header, "query", and the error level.  That seems easily fixable.
>
> I remain unconvinced that this is the best possible output.
>
> alvherre=# create function f() returns int language plpgsql as $$
> begin select
> var
> from
> foo; end; $$;
> CREATE FUNCTION
> alvherre=# check function f();
>                     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 :).

I'll look on this topic tomorrow and I hope this will be solvable simply.

Regards

Pavel

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Jaskiewicz 2012-03-04 19:33:33 Re: autovacuum locks
Previous Message hubert depesz lubaczewski 2012-03-04 18:37:19 Re: Our regex vs. POSIX on "longest match"