Re: Question about function body checking and 8.1 - Mailing list pgsql-general

From Alvaro Herrera
Subject Re: Question about function body checking and 8.1
Date
Msg-id 20050322172310.GA16109@dcc.uchile.cl
Whole thread Raw
In response to Re: Question about function body checking and 8.1  (Peter Eisentraut <peter_e@gmx.net>)
Responses Re: Question about function body checking and 8.1
Re: Question about function body checking and 8.1
List pgsql-general
On Tue, Mar 22, 2005 at 06:09:28PM +0100, Peter Eisentraut wrote:
> tony_caduto@amsoftwaredesign.com 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:

alvherre=# select version();
                                          version
--------------------------------------------------------------------------------------------
 PostgreSQL 8.0.1 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 3.3.5 (Debian 1:3.3.5-12)
(1 fila)

alvherre=# create function test_syntax() returns void language plpgsql as 'begin zelect 1; return; end';
CREATE FUNCTION
alvherre=# select test_syntax();
ERROR:  error de sintaxis en o cerca de «zelect» en el carácter 1
QUERY:  zelect 1
CONTEXT:  PL/pgSQL function "test_syntax" line 1 at SQL statement
LINEA 1: zelect 1
         ^
alvherre=#


One would think that this is a pretty obvious syntax error ...

--
Alvaro Herrera (<alvherre[@]dcc.uchile.cl>)
One man's impedance mismatch is another man's layer of abstraction.
(Lincoln Yeoh)

pgsql-general by date:

Previous
From: Richard Huxton
Date:
Subject: Re: Question about function body checking and 8.1
Next
From: Konstantinos Agouros
Date:
Subject: OSX, ODBC and Office 2004