Re: fori stmt with by keyword was:(Re: [HACKERS] for statement,

Lists: pgsql-patches
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
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

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

On 4/30/06, Jaime Casanova <systemguards(at)gmail(dot)com> wrote:
> 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 ready, at least it seems to me... also i have added some
lines to the docs...

let me know what your decision is about this...

--
regards,
Jaime Casanova

"Programming today is a race between software engineers striving to
build bigger and better idiot-proof programs and the universe trying
to produce bigger and better idiots.
So far, the universe is winning."
Richard Cook

Attachment Content-Type Size
fori.patch text/x-patch 7.5 KB

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Jaime Casanova <systemguards(at)gmail(dot)com>
Cc: PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: fori stmt with by keyword was:(Re: [HACKERS] for statement,
Date: 2006-05-30 12:18:48
Message-ID: 200605301218.k4UCImc14769@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches


I went to test this patch and got the attached regression failures.
Please repair and resubmit. Thanks.

---------------------------------------------------------------------------

Jaime Casanova wrote:
> On 4/30/06, Jaime Casanova <systemguards(at)gmail(dot)com> wrote:
> > 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 ready, at least it seems to me... also i have added some
> lines to the docs...
>
> let me know what your decision is about this...
>
> --
> regards,
> Jaime Casanova
>
> "Programming today is a race between software engineers striving to
> build bigger and better idiot-proof programs and the universe trying
> to produce bigger and better idiots.
> So far, the universe is winning."
> Richard Cook

--
Bruce Momjian http://candle.pha.pa.us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

Attachment Content-Type Size
unknown_filename text/plain 3.6 KB

From: "Jaime Casanova" <systemguards(at)gmail(dot)com>
To: "Bruce Momjian" <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: fori stmt with by keyword was:(Re: [HACKERS] for statement,
Date: 2006-06-07 06:00:45
Message-ID: c2d9e70e0606062300j310f1964k2fab66bbffeb9978@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

On 5/30/06, Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> wrote:
>
> I went to test this patch and got the attached regression failures.
> Please repair and resubmit. Thanks.
>

did it. sorry for the delay, i was busy this week.

--
Atentamente,
Jaime Casanova

"Programming today is a race between software engineers striving to
build bigger and better idiot-proof programs and the universe trying
to produce bigger and better idiots.
So far, the universe is winning."
Richard Cook

Attachment Content-Type Size
fori.patch application/octet-stream 8.5 KB

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Jaime Casanova <systemguards(at)gmail(dot)com>
Cc: PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: fori stmt with by keyword was:(Re: [HACKERS] for statement,
Date: 2006-06-12 16:45:04
Message-ID: 200606121645.k5CGj5E08053@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches


Patch applied. Thanks.

---------------------------------------------------------------------------

Jaime Casanova wrote:
> On 5/30/06, Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> wrote:
> >
> > I went to test this patch and got the attached regression failures.
> > Please repair and resubmit. Thanks.
> >
>
> did it. sorry for the delay, i was busy this week.
>
> --
> Atentamente,
> Jaime Casanova
>
> "Programming today is a race between software engineers striving to
> build bigger and better idiot-proof programs and the universe trying
> to produce bigger and better idiots.
> So far, the universe is winning."
> Richard Cook

[ Attachment, skipping... ]

>
> ---------------------------(end of broadcast)---------------------------
> TIP 9: In versions below 8.0, the planner will ignore your desire to
> choose an index scan if your joining column's datatypes do not
> match

--
Bruce Momjian http://candle.pha.pa.us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +