fori stmt with by keyword was:(Re: [HACKERS] for statement, adding a STEP clause?)

From: "Jaime Casanova" <systemguards(at)gmail(dot)com>
To: PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: fori stmt with by keyword was:(Re: [HACKERS] for statement, adding a STEP clause?)
Date: 2006-04-30 20:24:02
Message-ID: c2d9e70e0604301324i6f78eafdt2f9a0908bec3af18@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

On 4/29/06, Andrew Dunstan <andrew(at)dunslane(dot)net> wrote:
> Tom Lane wrote:
>
> >"Jaime Casanova" <systemguards(at)gmail(dot)com> writes:
> >
> >
> >>there is a chance to add a STEP clause to the FOR statement in plpgsql?
> >>
> >>
> >
> >This is not free: it'd require making STEP a reserved word (at least
> >within plpgsql) which is contrary to spec. I think you need to make
> >a pretty good case why the value of the feature outweighs breaking
> >applications that have perfectly-legally used "step" as an identifier.
> >
> >
>
> This isn't available in PL/SQL, is it? That doesn't mean we shouldn't do it, of course, but it might lessen any perceived imperative.
>
> Maybe using BY instad of STEP as the keyword would make it easier, since its occurrence in SQL makes it less likely to be used as a variable.
>
> cheers
>
> andrew
>
>

Hi,

i make a little patch using BY instead of STEP per Tom's complaint and
Andrew's suggestion.

the patch is not ready yet because i can't figure out how to make the
BY optional and that is mandatory because backward compatibility...

the problem is how to manage it in gram.y

perhaps someone with more expertise in gram.y can make suggestions?
also, you can review the patch and say if it will be added if i can
solve the optional BY problem... then i can start working in fixing
the docs

--
regards,
Jaime Casanova

"What they (MySQL) lose in usability, they gain back in benchmarks, and that's
all that matters: getting the wrong answer really fast."
Randal L. Schwartz

Attachment Content-Type Size
fori.patch text/x-patch 4.4 KB
test.sql text/x-sql 261 bytes

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Gevik Babakhani 2006-04-30 22:17:56 Re: Patch for %Allow per-database permissions to be set
Previous Message Tom Lane 2006-04-30 19:29:08 Re: Patch for %Allow per-database permissions to be set via