Re: plpgsql.warn_shadow

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Joel Jacobson <joel(at)trustly(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Marko Tiikkaja <marko(at)joh(dot)to>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: plpgsql.warn_shadow
Date: 2014-03-04 21:12:53
Message-ID: 531641D5.4070300@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On 03/04/2014 03:40 PM, Joel Jacobson wrote:
> On Tue, Mar 4, 2014 at 8:04 PM, Andrew Dunstan <andrew(at)dunslane(dot)net> wrote:
>> Lots of code quite correctly relies on this,
>> including some I have written.
> I really cannot see when it would be a good coding practise to do so,
> there must be something I don't understand, I would greatly appreciate
> if you can give a real-life example of such a PL/pgSQL function.
>

I can't give you one because it's not mine to share. But I can tell you
a couple of ways I have seen it come about.

One is when a piece if code is re-used in another function which happens
to have a parameter name which is the same. Another is when translating
some code and this is the simplest way to do it, with the least effort
involved.

If I am writing a piece of green fields code, than like you I avoid
this. But the vast majority of what I do for people is not green fields
code.

In any case, it's not our responsibility to enforce a coding standard.
That's a management issue, in the end, not a technological issue.

cheers

andrew

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Kohei KaiGai 2014-03-04 21:34:36 Re: Custom Scan APIs (Re: Custom Plan node)
Previous Message Robert Haas 2014-03-04 20:54:24 Re: ALTER TABLE lock strength reduction patch is unsafe