Received: from bugs.unl.edu.ar (bugs.unl.edu.ar [168.96.132.208]) by postgresql.org (8.11.3/8.11.4) with ESMTP id fAFDxqm11639 for ; Thu, 15 Nov 2001 08:59:53 -0500 (EST) (envelope-from martin@bugs.unl.edu.ar) Received: from localhost (localhost [127.0.0.1]) by bugs.unl.edu.ar (Postfix) with ESMTP id 8EAF42AB3E for ; Thu, 15 Nov 2001 10:57:56 -0300 (GMT) Received: by bugs.unl.edu.ar (Postfix, from userid 1004) id B3BCA2AB3F; Thu, 15 Nov 2001 10:57:55 -0300 (GMT) Content-Type: text/plain; charset="iso-8859-1" From: =?iso-8859-1?q?Mart=EDn=20Marqu=E9s?= To: pgsql-sql@postgresql.org Subject: Re: Unable to use '-' in column names in PLPGSQL Date: Thu, 15 Nov 2001 10:57:54 -0300 X-Mailer: KMail [version 1.3] References: <20011115133813.8842.qmail@ns.krot.org> In-Reply-To: <20011115133813.8842.qmail@ns.krot.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <20011115135755.B3BCA2AB3F@bugs.unl.edu.ar> X-Virus-Scanned: by AMaViS snapshot-20011106 X-Archive-Number: 200111/203 X-Sequence-Number: 5587 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@unl.edu.ar Programador, Administrador, DBA | Centro de Telematica Universidad Nacional del Litoral -----------------------------------------------------------------