Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

for statement, adding a STEP clause?


  • From: "Jaime Casanova" <systemguards(at)gmail(dot)com>
  • To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
  • Subject: for statement, adding a STEP clause?
  • Date: Sat, 29 Apr 2006 00:14:17 -0500
  • Message-id: <c2d9e70e0604282214j6a8a3011haac82dce885b4b4a(at)mail(dot)gmail(dot)com>

Hi,

there is a chance to add a STEP clause to the FOR statement in plpgsql?

something like

FOR i IN 1..100 STEP 2 LOOP
END LOOP

the STEP value must be a positive value because of the effect of the
REVERSE clause...

i think it's just a matter of fixing  gram.y, plpgsql.h (to add
another PLpgSQL_expr to the stmt_fori) and pl_exec.c (the way the
internal variable is incremented here makes me think that i wasn't the
first one with this idea)

i'm missing something? is "STEP" a good name for this? i will make a
try tomorrow

any ideas and suggestions are welcome...

--
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



Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group