Re: [HACKERS] PL/pgSQL RENAME functionality in TODOs

2007-02-02 Thread Jim Nasby
On Feb 1, 2007, at 5:08 AM, Pavel Stehule wrote: std. use rename only for triggers and variables new and old. It has sense. I don't see sense for rename in clasic plpgsql functions. There was one reason, rename unnamed $params. But currently plpgsql support named params and this reason is

Re: [HACKERS] PL/pgSQL RENAME functionality in TODOs

2007-02-02 Thread Pavel Stehule
But I think a way to get around that would be to RENAME the arguments in the DECLARE section, so user_id could become p_user_id under the covers. It's one case. But I don't belive so result will be more readable. Better solution is using names qualificated by function name. I am not sure

Re: [HACKERS] PL/pgSQL RENAME functionality in TODOs

2007-02-02 Thread imad
On 2/2/07, Jim Nasby [EMAIL PROTECTED] wrote: On Feb 1, 2007, at 5:08 AM, Pavel Stehule wrote: std. use rename only for triggers and variables new and old. It has sense. I don't see sense for rename in clasic plpgsql functions. There was one reason, rename unnamed $params. But currently

Re: [HACKERS] PL/pgSQL RENAME functionality in TODOs

2007-02-02 Thread Tom Lane
imad [EMAIL PROTECTED] writes: So, should we still consider it a ToDo? Whatever you think about the rename-in-same-block-as-declared case, it's still broken, as per my example showing that the effects are not limited to the containing block. However, considering that no one has taken an

Re: [HACKERS] PL/pgSQL RENAME functionality in TODOs

2007-02-01 Thread imad
On 2/1/07, Tom Lane [EMAIL PROTECTED] wrote: imad [EMAIL PROTECTED] writes: OK, so renaming does not work in the same block. You can rename a vairable in a nested block and thats why it works for OLD/NEW. BTW, what is the purpose behind it? Declaring a variable in a block and quickly

Re: [HACKERS] PL/pgSQL RENAME functionality in TODOs

2007-02-01 Thread Pavel Stehule
Hello, std. use rename only for triggers and variables new and old. It has sense. I don't see sense for rename in clasic plpgsql functions. There was one reason, rename unnamed $params. But currently plpgsql support named params and this reason is obsolete. Regards Pavel Stehule

Re: [HACKERS] PL/pgSQL RENAME functionality in TODOs

2007-01-31 Thread Tom Lane
imad [EMAIL PROTECTED] writes: OK, so renaming does not work in the same block. You can rename a vairable in a nested block and thats why it works for OLD/NEW. BTW, what is the purpose behind it? Declaring a variable in a block and quickly renaming it does not make sense to me. I agree

Re: [HACKERS] PL/pgSQL RENAME functionality in TODOs

2007-01-30 Thread Tom Lane
imad [EMAIL PROTECTED] writes: Fix RENAME to work on variables other than OLD/NEW I can rename just any variable declared in a PL block apart from OLD/NEW. Is the TODOs list out of sync or I am missing the point here? Really? It looks pretty broken to me still: regression=# create function

Re: [HACKERS] PL/pgSQL RENAME functionality in TODOs

2007-01-30 Thread Bruce Momjian
URL added to TODO. (I didn't have URLs in there at the time). --- Tom Lane wrote: imad [EMAIL PROTECTED] writes: Fix RENAME to work on variables other than OLD/NEW I can rename just any variable declared in a PL block

Re: [HACKERS] PL/pgSQL RENAME functionality in TODOs

2007-01-30 Thread imad
OK, so renaming does not work in the same block. You can rename a vairable in a nested block and thats why it works for OLD/NEW. BTW, what is the purpose behind it? Declaring a variable in a block and quickly renaming it does not make sense to me. --Imad www.EnterpriseDB.com On 1/31/07, Bruce