X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id A48A4D1CA50 for ; Fri, 23 Apr 2004 10:19:02 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 06931-10 for ; Fri, 23 Apr 2004 10:19:04 -0300 (ADT) Received: from bugs.unl.edu.ar (bugs.unl.edu.ar [168.96.132.208]) by svr1.postgresql.org (Postfix) with ESMTP id BB475D1C951 for ; Fri, 23 Apr 2004 10:19:00 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by bugs.unl.edu.ar (Postfix) with ESMTP id E8D8E11EBD for ; Fri, 23 Apr 2004 10:18:53 -0300 (ART) Received: from bugs.unl.edu.ar ([127.0.0.1]) by localhost (bugs [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 30218-04 for ; Fri, 23 Apr 2004 10:18:53 -0300 (ART) Received: from localhost (localhost [127.0.0.1]) by bugs.unl.edu.ar (Postfix) with ESMTP id 1DB4411DF5 for ; Fri, 23 Apr 2004 10:18:53 -0300 (ART) From: Martin Marques To: pgsql-sql@postgresql.org Subject: CONTEXT on PL/pgSQL Date: Fri, 23 Apr 2004 10:18:51 -0300 User-Agent: KMail/1.5.4 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200404231018.51461.martin@bugs.unl.edu.ar> X-Virus-Scanned: by amavisd-new-20030616-p7 (Debian) at unl.edu.ar X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.3 tagged_above=0.0 required=5.0 tests=UPPERCASE_25_50 X-Spam-Level: X-Archive-Number: 200404/257 X-Sequence-Number: 17632 I have a simple function made with PL/pgSQL and when I call it I get this i= n=20 the logs: 2004-04-23 10:15:32 [30669] LOG: statement: SELECT nodoSuperior(22) AS sup 2004-04-23 10:15:32 [30669] LOG: statement: SELECT $1 CONTEXT: PL/pgSQL function "nodosuperior" line 7 at assignment 2004-04-23 10:15:32 [30669] LOG: statement: SELECT codigo,padre,nombre FR= OM=20 procesos WHERE codigo=3D $1 CONTEXT: PL/pgSQL function "nodosuperior" line 10 at select into variables 2004-04-23 10:15:32 [30669] LOG: statement: SELECT $1 IS NULL CONTEXT: PL/pgSQL function "nodosuperior" line 12 at exit 2004-04-23 10:15:32 [30669] LOG: statement: SELECT $1 CONTEXT: PL/pgSQL function "nodosuperior" line 16 at return What does CONTEXT mean, and is everything ok? The function is this: CREATE OR REPLACE FUNCTION nodoSuperior(INT) RETURNS VARCHAR AS ' DECLARE COD INT; SUP RECORD; BEGIN COD:=3D$1; LOOP SELECT INTO SUP codigo,padre,nombre=20 FROM procesos WHERE codigo=3DCOD; EXIT WHEN SUP.padre IS NULL; COD:=3DSUP.padre; END LOOP; RETURN SUP.nombre; END; ' LANGUAGE 'plpgsql'; --=20 10:16:01 up 45 days, 14:40, 3 users, load average: 0.54, 0.61, 0.63 ----------------------------------------------------------------- Mart=EDn Marqu=E9s | select 'mmarques' || '@' || 'unl.edu.ar' Centro de Telematica | DBA, Programador, Administrador Universidad Nacional del Litoral -----------------------------------------------------------------