From: Tom Lane <tgl@sss.pgh.pa.us>
To: Daniel Caune <daniel.caune@ubisoft.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Local variable and column name conflict
Date: Mon, 03 Jul 2006 11:37:54 -0400
Message-ID: <3434.1151941074@sss.pgh.pa.us> (raw)
In-Reply-To: <1E293D3FF63A3740B10AD5AAD88535D2029164E4@UBIMAIL1.ubisoft.org>
References: <1E293D3FF63A3740B10AD5AAD88535D2029164E4@UBIMAIL1.ubisoft.org>
"Daniel Caune" <daniel.caune@ubisoft.com> writes:
> CREATE OR REPLACE FUNCTION foo(i IN int)
> RETURNS void
> AS $$
> BEGIN
> UPDATE bar
> SET i = i; // column i = parameter i
> END;
> $$ LANGUAGE PLPGSQL;
In SELECTs you can qualify the column, ie, bar.i vs i. That doesn't
work for an UPDATE target, though, so probably the best answer is
"don't do that". I think it's entirely too error-prone anyway ...
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: tgl@sss.pgh.pa.us, daniel.caune@ubisoft.com
Subject: Re: Local variable and column name conflict
In-Reply-To: <3434.1151941074@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox