Re: plpgsql keywords are hidden reserved words

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: John DeSoi <desoi(at)pgedit(dot)com>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: plpgsql keywords are hidden reserved words
Date: 2007-11-05 18:07:19
Message-ID: 23353.1194286039@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

John DeSoi <desoi(at)pgedit(dot)com> writes:
> Is there any feasibility to the idea of allowing pl/pgsql variables
> and parameters to be prefixed with a special character like '$'?

I find this (a) really ugly, (b) incompatible with Oracle, which
you'll recall is one of the main driving ideas for plpgsql, and
(c) almost certainly a lexical conflict with dollar quoting.

Most other special characters you might suggest would create
parsing ambiguities too.

> I'm constantly adding prefixes like 'v_' because of conflicts with table
> or column names.

The reason you have to do that is that we got the lookup order backward:
per Oracle, column names within a query should bind more tightly than
plpgsql variable names, and if you need to disambiguate you qualify
the variables. We should fix that instead of bogotifying the syntax.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2007-11-05 18:13:19 Re: Open items for 8.3
Previous Message John DeSoi 2007-11-05 17:58:55 Re: plpgsql keywords are hidden reserved words