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

From Aasmund Midttun Godal
Subject Unable to use '-' in column names in PLPGSQL
Date
Msg-id 20011115133813.8842.qmail@ns.krot.org
Whole thread Raw
Responses Re: Unable to use '-' in column names in PLPGSQL  (Martín Marqués <martin@bugs.unl.edu.ar>)
Re: Unable to use '-' in column names in PLPGSQL  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-sql
CREATE FUNCTION is_parent(INTEGER, INTEGER) RETURNS BOOLEAN AS '       DECLARE parent ALIAS FOR $1; tull ALIAS for $2;
kidINTEGER;      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';

Will cause the following compilation error:

NOTICE:  plpgsql: ERROR during compile of is_parent near line 8
ERROR:  unterminated "

If I change the column name to dir_id it works fine.

It does not matter whether or not I use quotes.

Aasmund Midttun Godal

aasmund@godal.com - http://www.godal.com/
+47 40 45 20 46


pgsql-sql by date:

Previous
From: Brian@McSweeney.iol.ie (Brian)
Date:
Subject: INSERT question
Next
From: "Wilco Boschman"
Date:
Subject: Re: Insert values from one existing table into a new table.