Lists: | pgsql-patches |
---|
From: | "Gevik Babakhani" <pgdev(at)xs4all(dot)nl> |
---|---|
To: | <pgsql-patches(at)postgresql(dot)org> |
Cc: | "'Tom Lane'" <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Subject: | proposed patch for function parameters name refs |
Date: | 2007-11-27 12:24:37 |
Message-ID: | 003c01c830f0$7e35f9d0$0a01a8c0@gevmus |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-patches |
This patch implements the function parameter referencing by name as
discussed before.
Please find the version 1.0 of this patch at http://www.postgresql.nl/gevik/
The zip archive contains a combined and separate patches to make reviewing
easier.
How this patch is implemented:
As discussed before, a generic parser callback functionality has been
implemented
to create hooks from within the parser. The mechanism of handling refnames
acts only
when the parser is in context of parsing a function AND all of the previous
attempts to
recognize an unknown refname (also after implicit RTE) has failed. This way
the match
for a possible function parameter name is executed as a last measure.
notes:
- a new error code has been added: ERRCODE_UNDEFINED_FUNCTION_PARAMETER_NAME
- when a given refname is unrecognized after all matches, one of the two
following
error messages is shown:
a) "there is no parameter %s defined for function %s"
b) "there is no parameter %s.%s defined for function %s or this \n is
an invalid reference to FROM-clause entry for table \"%s\""
- 2 new files have been added parse_callback.h and .c
- the patch also contains test for regression
- the main logic is implemented in transformColumnRef/ case 1 and case 2
- patch is created using VC++ 2005, tested on Win32 and RH4
------------------------------------------------
Gevik Babakhani
PostgreSQL NL http://www.postgresql.nl
TrueSoftware BV http://www.truesoftware.nl
------------------------------------------------
From: | Bruce Momjian <bruce(at)momjian(dot)us> |
---|---|
To: | Gevik Babakhani <pgdev(at)xs4all(dot)nl> |
Cc: | pgsql-patches(at)postgresql(dot)org, "'Tom Lane'" <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Subject: | Re: proposed patch for function parameters name refs |
Date: | 2007-11-28 22:45:01 |
Message-ID: | 200711282245.lASMj1f18406@momjian.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-patches |
This has been saved for the 8.4 release:
http://momjian.postgresql.org/cgi-bin/pgpatches_hold
---------------------------------------------------------------------------
Gevik Babakhani wrote:
>
> This patch implements the function parameter referencing by name as
> discussed before.
> Please find the version 1.0 of this patch at http://www.postgresql.nl/gevik/
>
> The zip archive contains a combined and separate patches to make reviewing
> easier.
>
> How this patch is implemented:
> As discussed before, a generic parser callback functionality has been
> implemented
> to create hooks from within the parser. The mechanism of handling refnames
> acts only
> when the parser is in context of parsing a function AND all of the previous
> attempts to
> recognize an unknown refname (also after implicit RTE) has failed. This way
> the match
> for a possible function parameter name is executed as a last measure.
>
> notes:
>
> - a new error code has been added: ERRCODE_UNDEFINED_FUNCTION_PARAMETER_NAME
> - when a given refname is unrecognized after all matches, one of the two
> following
> error messages is shown:
>
> a) "there is no parameter %s defined for function %s"
> b) "there is no parameter %s.%s defined for function %s or this \n is
> an invalid reference to FROM-clause entry for table \"%s\""
>
> - 2 new files have been added parse_callback.h and .c
> - the patch also contains test for regression
> - the main logic is implemented in transformColumnRef/ case 1 and case 2
> - patch is created using VC++ 2005, tested on Win32 and RH4
>
>
> ------------------------------------------------
> Gevik Babakhani
>
> PostgreSQL NL http://www.postgresql.nl
> TrueSoftware BV http://www.truesoftware.nl
> ------------------------------------------------
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly
--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://postgres.enterprisedb.com
+ If your life is a hard drive, Christ can be your backup. +