Re: named parameters in SQL functions

From: Brendan Jurd <direvus(at)gmail(dot)com>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: named parameters in SQL functions
Date: 2009-11-15 18:58:05
Message-ID: 37ed240d0911151058x5d562b80o7993034090361060@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2009/11/16 Andrew Dunstan <andrew(at)dunslane(dot)net>:
> At Tom's suggestion I am looking at allowing use of parameter names in SQL
> functions instead of requiring use of $1 etc. That raises the question of
> how we would disambiguate a parameter name from a column name. Essentially,
> ISTM, we could use some special marker such as @ (c.f. SQL Server) or :
> (c.f. ecpg) or else we could have some rule that says which name takes
> precedence. I think I prefer a special marker, other things being equal. Is
> there a standard on this?

Sorry if I'm missing something important here, but why not just
resolve the parameter names in whatever way PL/PgSQL has been doing
it? It seems to work well.

FWIW I always prefix my parameter names with _ to differentiate them
from columns.

Cheers,
BJ

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2009-11-15 18:59:39 Re: named parameters in SQL functions
Previous Message Simon Riggs 2009-11-15 18:57:55 Re: Summary and Plan for Hot Standby