Support plpgsql multi-range in conditional control

From: "2903807914(at)qq(dot)com" <2903807914(at)qq(dot)com>
To: pgsql-hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Cc: 1276576182 <1276576182(at)qq(dot)com>
Subject: Support plpgsql multi-range in conditional control
Date: 2023-01-19 09:23:05
Message-ID: tencent_BB05B615DE248D010981E035509EB2C84907@qq.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Dear hackers, my good friend Hou Jiaxing and I have implemented a version of the code that supports multiple integer range conditions in the in condition control of the for loop statement in the plpgsql procedural language. A typical example is as follows:

postgres=# do $$
declare
i int := 10;
begin
for i in 1..10 by 3, reverse i+10..i+1 by 3 loop
raise info '%', i;
end loop;
end $$;
INFO: 1
INFO: 4
INFO: 7
INFO: 10
INFO: 20
INFO: 17
INFO: 14
INFO: 11
do
postgres=#

Hope to get your feedback, thank you!

2903807914(at)qq(dot)com

Attachment Content-Type Size
0001-Support-plpgsql-multi-range-in-conditional-control.patch application/octet-stream 19.4 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message tushar 2023-01-19 09:35:01 Re: CREATEROLE users vs. role properties
Previous Message Egor Chindyaskin 2023-01-19 09:18:42 Re: Stack overflow issue