Support plpgsql multi-range in conditional control - Mailing list pgsql-hackers

From 2903807914@qq.com
Subject Support plpgsql multi-range in conditional control
Date
Msg-id tencent_BB05B615DE248D010981E035509EB2C84907@qq.com
Whole thread Raw
Responses Re: Support plpgsql multi-range in conditional control
List 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@qq.com
Attachment

pgsql-hackers by date:

Previous
From: Egor Chindyaskin
Date:
Subject: Re: Stack overflow issue
Next
From: tushar
Date:
Subject: Re: CREATEROLE users vs. role properties