Unable to use '-' in column names in PLPGSQL

From: "Aasmund Midttun Godal" <postgresql(at)envisity(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Unable to use '-' in column names in PLPGSQL
Date: 2001-11-15 13:38:13
Message-ID: 20011115133813.8842.qmail@ns.krot.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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

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(at)godal(dot)com - http://www.godal.com/
+47 40 45 20 46

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Martín Marqués 2001-11-15 13:57:54 Re: Unable to use '-' in column names in PLPGSQL
Previous Message Sharmad Naik 2001-11-15 06:56:01 Re: error in postgresql