From: | Martijn van Oosterhout <kleptog(at)svana(dot)org> |
---|---|
To: | Raphaël Jacquot <sxpert(at)sxpert(dot)org> |
Cc: | pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: wishlist for 8.4 |
Date: | 2008-02-14 13:30:15 |
Message-ID: | 20080214133015.GB13453@svana.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Thu, Feb 14, 2008 at 07:51:31AM +0100, Raphaël Jacquot wrote:
> in fact, I got stuck in pl/pgsql with the fact that there's no way to
> access the NEW tuple in an indirect way, having the name of the column
> in some variable. (I found that it could be done in plperl, but that
> left me with a taste of un-completeness...)
>
> so, I propose the use of
>
> NEW[variable_containing_the_column_name]
It's not that simple. pl/pgsql is a statically typed language. Which
means the types of the variable aren't really allowed to change
between executions. The problem with your construct is that you can't
tell a priori what its type is.
The problem stems (I beleive) from the postgresql parser itself, since
SQL doesn't have the structure you want either, and pl/pgsql uses the
SQL parser for all the hard work. The reason why other languages can do
it is because they are typed at run-time, not compile time.
Have a nice day,
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> Those who make peaceful revolution impossible will make violent revolution inevitable.
> -- John F Kennedy
From | Date | Subject | |
---|---|---|---|
Next Message | Simon Riggs | 2008-02-14 13:44:18 | Reworking WAL locking |
Previous Message | Alvaro Herrera | 2008-02-14 13:27:37 | Re: Show INHERIT in \du |