pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Martín Marqués <martin@bugs.unl.edu.ar>
To: pgsql-sql@postgresql.org
Subject: Re: Unable to use '-' in column names in PLPGSQL
Date: Thu, 15 Nov 2001 10:57:54 -0300
Message-ID: <20011115135755.B3BCA2AB3F@bugs.unl.edu.ar> (raw)
In-Reply-To: <20011115133813.8842.qmail@ns.krot.org>
References: <20011115133813.8842.qmail@ns.krot.org>

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
-----------------------------------------------------------------



view thread (3+ messages)  latest in thread

Message-ID: <20011115135755.B3BCA2AB3F@bugs.unl.edu.ar>
Permalink:  ../20011115135755.B3BCA2AB3F@bugs.unl.edu.ar/
Also on:    postgresql.org/message-id/20011115135755.B3BCA2AB3F@bugs.unl.edu.ar

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: martin@bugs.unl.edu.ar
  Subject: Re: Unable to use '-' in column names in PLPGSQL
  In-Reply-To: <20011115135755.B3BCA2AB3F@bugs.unl.edu.ar>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox