From: | Martín Marqués <martin(at)bugs(dot)unl(dot)edu(dot)ar> |
---|---|
To: | pgsql-sql(at)postgresql(dot)org |
Subject: | Re: Unable to use '-' in column names in PLPGSQL |
Date: | 2001-11-15 13:57:54 |
Message-ID: | 20011115135755.B3BCA2AB3F@bugs.unl.edu.ar |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
On Jue 15 Nov 2001 10:38, you wrote:
> CREATE FUNCTION is_parent(INTEGER, INTEGER) RETURNS BOOLEAN AS '
> DECLARE
> parent ALIAS FOR $1;
> tull ALIAS for $2;
> kid INTEGER;
> BEGIN
> kid := tull;
> LOOP
> SELECT INTO kid "dir-id" FROM dir WHERE id = kid;
> IF kid = parent THEN
> RETURN TRUE;
> END IF;
> IF kid IS NULL THEN
> RETURN FALSE;
> END IF;
> END LOOP;
> END;
> ' LANGUAGE 'plpgsql';
You shoun't use '-' in column names. Use '_' instead.
Saludos... :-)
P.D.: Doesn't it give you an error when you try to create the table with does
column names?
--
Porqué usar una base de datos relacional cualquiera,
si podés usar PostgreSQL?
-----------------------------------------------------------------
Martín Marqués | mmarques(at)unl(dot)edu(dot)ar
Programador, Administrador, DBA | Centro de Telematica
Universidad Nacional
del Litoral
-----------------------------------------------------------------
From | Date | Subject | |
---|---|---|---|
Next Message | Stephan Szabo | 2001-11-15 15:03:16 | Re: INSERT question |
Previous Message | Aasmund Midttun Godal | 2001-11-15 13:38:13 | Unable to use '-' in column names in PLPGSQL |