Re: 8.1 and syntax checking at create time

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Tony Caduto <tony_caduto(at)amsoftwaredesign(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: 8.1 and syntax checking at create time
Date: 2005-08-31 18:54:29
Message-ID: 20050831185429.GA19872@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Aug 31, 2005 at 01:13:00PM -0500, Tony Caduto wrote:
> From what I have seen it does not check anything in the body of the
> function, I can put gibberish in the body as long as it has a begin and end.
>
> It does not seem to be doing anything differently than 8.0.x does with
> function syntax checking at create time, so why even mention it in the
> release notes?

I see different behavior in 8.1 than in 8.0. Are you *sure* you're
connected to an 8.1 system when you're running your tests?

Are you using a database that was restored from an earlier version
of PostgreSQL? I wonder if you're not getting the lanvalidator
function. What's the result of the following query?

SELECT lanname,
lanplcallfoid, lanplcallfoid::regprocedure,
lanvalidator, lanvalidator::regprocedure
FROM pg_language;

What happens if you create a fresh database and run "createlang
plpgsql" in it, and then run your tests?

> the function below also raises no errors at create, but at run time it does.

With the example you posted I get the following at create time:

ERROR: type "record44" does not exist
CONTEXT: compile of PL/pgSQL function "test_func9" near line 2

If I change "record44" to "record" then I get the following (again,
at create time):

ERROR: syntax error at or near "asfdfdfdfafdsfsdfsdf" at character 1
QUERY: asfdfdfdfafdsfsdfsdf sdf bla bla sdf yada yada s df sd fsd END
CONTEXT: SQL statement in PL/PgSQL function "test_func9" near line 10
LINE 1: asfdfdfdfafdsfsdfsdf sdf bla bla sdf yada yada s df sd fsd E...
^

> From what I read in the release notes I was expecting to see this
> raised at create time.

Create-time checking works here.

--
Michael Fuhr

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Josh Berkus 2005-08-31 18:59:47 Re: 8.1 and syntax checking at create time
Previous Message Tom Lane 2005-08-31 18:44:40 Re: 8.1 and syntax checking at create time