Re: Unable to use '-' in column names in PLPGSQL - Mailing list pgsql-sql

From Martín Marqués
Subject Re: Unable to use '-' in column names in PLPGSQL
Date
Msg-id 20011115135755.B3BCA2AB3F@bugs.unl.edu.ar
Whole thread Raw
In response to Unable to use '-' in column names in PLPGSQL  ("Aasmund Midttun Godal" <postgresql@envisity.com>)
List 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@unl.edu.ar
Programador, Administrador, DBA |       Centro de Telematica                      Universidad Nacional
        del Litoral
 
-----------------------------------------------------------------


pgsql-sql by date:

Previous
From: "Jack Gao"
Date:
Subject: Is this a bug?
Next
From: gntrs@hotmail.com (Gintas)
Date:
Subject: Help with INSERT into 2 tables