From: | Martin Marques <martin(at)bugs(dot)unl(dot)edu(dot)ar> |
---|---|
To: | pgsql-sql(at)postgresql(dot)org |
Subject: | CONTEXT on PL/pgSQL |
Date: | 2004-04-23 13:18:51 |
Message-ID: | 200404231018.51461.martin@bugs.unl.edu.ar |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
I have a simple function made with PL/pgSQL and when I call it I get this in
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 FROM
procesos WHERE codigo= $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:=$1;
LOOP
SELECT INTO SUP codigo,padre,nombre
FROM procesos WHERE codigo=COD;
EXIT WHEN SUP.padre IS NULL;
COD:=SUP.padre;
END LOOP;
RETURN SUP.nombre;
END;
' LANGUAGE 'plpgsql';
--
10:16:01 up 45 days, 14:40, 3 users, load average: 0.54, 0.61, 0.63
-----------------------------------------------------------------
Martín Marqués | select 'mmarques' || '@' || 'unl.edu.ar'
Centro de Telematica | DBA, Programador, Administrador
Universidad Nacional
del Litoral
-----------------------------------------------------------------
From | Date | Subject | |
---|---|---|---|
Next Message | Antal Attila | 2004-04-23 13:32:13 | Multi ordered select and indexing |
Previous Message | Bruce Momjian | 2004-04-23 13:18:27 | Re: Server Side C programming Environment Set up |