Alvaro Herrera wrote:
> On Tue, Mar 22, 2005 at 06:09:28PM +0100, Peter Eisentraut wrote:
> > [EMAIL PROTECTED] wrote:
> > > currently when you execute a CREATE OR REPLACE FUNCTION there is
> > > virtually no checking of the function body for variable type
> > > compatibility or if the SQL statements are valid.
> >
> > Only for very small values of "no".  Please provide an example.
>
> Here's a simple one:

Well, mentioning that he was talking about PL/pgSQL would have 
helped. :)

Implementing this type of syntax checker isn't hard since the code is 
already there, but there might be a small, ugly problem.  IIRC, the 
parser and/or semantic analyzer of PL/pgSQL relies on knowing whether 
the function is called as a trigger.  You don't know that at creation 
phase.  So you'd need to relax the syntax checking in some ill-defined 
ways and propagate that relaxation flag all over the place.  But 
besides that, this is really just a typing exercise for someone.

-- 
Peter Eisentraut
http://developer.postgresql.org/~petere/

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

               http://archives.postgresql.org

Reply via email to