Re: plpgsql keywords are hidden reserved words

From: Decibel! <decibel(at)decibel(dot)org>
To: John DeSoi <desoi(at)pgedit(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: plpgsql keywords are hidden reserved words
Date: 2007-11-12 05:09:51
Message-ID: 6DCE8766-8547-4973-95A6-B87500B27607@decibel.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Nov 5, 2007, at 11:58 AM, John DeSoi wrote:
> Is there any feasibility to the idea of allowing pl/pgsql variables
> and parameters to be prefixed with a special character like '$'?
> I'm constantly adding prefixes like 'v_' because of conflicts with
> table or column names. It would be nice to have something like
> "declare $myvar integer;" so it would be very easy to distinguish
> variable and parameter names from structure names or reserved words.

+528,382 ;)

At least in 8.3, IIRC you can safely use the name of the function to
refer to variables, but it would be very nice if you could just do
$blah in embedded SQL statements.

While we're talking about plpgsql... is there a TODO to allow RAISE
to take a variable instead of just a fixed string? Yes, I can always
do RAISE '%', variable, but then I lose % expansion.
--
Decibel!, aka Jim C. Nasby, Database Architect decibel(at)decibel(dot)org
Give your computer some brain candy! www.distributed.net Team #1828

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Nikolay Samokhvalov 2007-11-12 06:33:47 Re: proposal casting from XML[] to int[], numeric[], text[]
Previous Message Decibel! 2007-11-12 04:54:52 Re: Proposal: Select ... AS OF Savepoint