From: Marko Kreen <markokr@gmail.com>
To: Pavel Stehule <pavel.stehule@gmail.com>
Cc: pgsql-patches <pgsql-patches@postgresql.org>
Subject: Re: review: table function support
Date: Thu, 10 Jul 2008 15:10:39 +0300
Message-ID: <e51f66da0807100510r3694cf63ubffaef81657502cc@mail.gmail.com> (raw)
In-Reply-To: <162867790807100158j6461ee76g639367c0547ec3bf@mail.gmail.com>
References: <e51f66da0807090405gd5ad4c3h892986181cf09d7a@mail.gmail.com>
<162867790807090838k1265ff70r1f312b26e7c4fefa@mail.gmail.com>
<162867790807100158j6461ee76g639367c0547ec3bf@mail.gmail.com>
On 7/10/08, Pavel Stehule <pavel.stehule@gmail.com> wrote:
> I am sending actualized patch
>
> Regards
> Pavel Stehule
>
> 2008/7/9 Pavel Stehule <pavel.stehule@gmail.com>:
>
> > 2008/7/9 Marko Kreen <markokr@gmail.com>:
> >> Generally, the patch looks fine. There are few issues still:
> >>
> >> - plpgsql: the result columns _do_ create local variables.
> >> AIUI, they should not?
> >
> > it was my mistake - it doesn't do local variables - fixed
> >>
> >> - pg_dump: is the psql_assert() introduction necessary, considering it
> >> is used only in one place?
> >
> > removed - argmode variables is checked before
> >>
> >> - There should be regression test for plpgsql too, that test if
> >> the behaviour is correct.
> >>
> >
> > addeded
> >> - The documentation should mention behaviour difference from OUT
> >> parameters.
> >
> > I will do it.
> >>
> >> Wishlist (probably out of scope for this patch):
> >
> > this is in my wishlist too, but postgresql doesn't support types like
> > result of functions.
> >>
> >> - plpgsql: a way to create record variable for result row. Something like:
> >>
> >> CREATE FUNCTION foo(..) RETURNS TABLE (..) AS $$
> >> DECLARE
> >> retval foo%ROWTYPE;
> >>
> >>
> >> Currently the OUT parameters are quite painful to use due to bad
> >> name resolving logic. Such feature would be perfect replacement.
> >>
> >> --
> >> marko
> >>
> > I'll send patch early, thank you much
Ok, last items:
- Attached is a patch that fixes couple C comments.
- I think plpgsql 38.1.2 chapter of "Supported Argument and Result Data
Types" should also have a mention of TABLE functions.
Then I'm content with the patch.
--
marko
Attachments:tbl.comments.diff (text/x-patch, 1.0K) downloaddiff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.cindex 3f90c93..6ae4521 100644--- a/src/bin/pg_dump/pg_dump.c+++ b/src/bin/pg_dump/pg_dump.c@@ -6847,7 +6847,7 @@ dumpFunc(Archive *fout, FuncInfo *finfo)
appendPQExpBuffer(q, "CREATE FUNCTION %s ", funcsig);
- /* swich between RETURNS SETOF RECORD and RETURNS TABLE functions */+ /* switch between RETURNS SETOF RECORD and RETURNS TABLE functions */
if (!is_returns_table_function(nallargs, argmodes))
{
rettypename = getFormattedTypeName(finfo->prorettype, zeroAsOpaque);
diff --git a/src/pl/plpgsql/src/pl_comp.c b/src/pl/plpgsql/src/pl_comp.cindex 612a84f..c683aea 100644--- a/src/pl/plpgsql/src/pl_comp.c+++ b/src/pl/plpgsql/src/pl_comp.c@@ -402,7 +402,7 @@ do_compile(FunctionCallInfo fcinfo,
PLpgSQL_variable *argvariable;
int argitemtype;
- /* skip PROARGMODE_TABLE params - these params hasn't local variables */+ /* PROARGMODE_TABLE params should not create local variables */
if (argmode == PROARGMODE_TABLE)
continue;
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-patches@postgresql.org
Cc: markokr@gmail.com, pavel.stehule@gmail.com
Subject: Re: review: table function support
In-Reply-To: <e51f66da0807100510r3694cf63ubffaef81657502cc@mail.gmail.com>
References: <e51f66da0807090405gd5ad4c3h892986181cf09d7a@mail.gmail.com> <162867790807090838k1265ff70r1f312b26e7c4fefa@mail.gmail.com> <162867790807100158j6461ee76g639367c0547ec3bf@mail.gmail.com> <e51f66da0807100510r3694cf63ubffaef81657502cc@mail.gmail.com>
* 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