Re: Re: Support plpgsql multi-range in conditional control

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: "2903807914(at)qq(dot)com" <2903807914(at)qq(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Re: Support plpgsql multi-range in conditional control
Date: 2023-01-19 15:54:43
Message-ID: CAFj8pRBqzy373f+1K0k+69WE4KKsTFBuGnK6755Tv7C0Yn0_ug@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

čt 19. 1. 2023 v 15:20 odesílatel 2903807914(at)qq(dot)com <2903807914(at)qq(dot)com>
napsal:

> Hello, thank you very much for your reply. But I think you may have
> misunderstood what we have done.
>
> What we do this time is that we can use multiple range ranges
> (condition_iterator) after in. Previously, we can only use such an interval
> [lower, upper] after in, but in some scenarios, we may need a list: *condition_
> iterator[,condition_iterator ...]*
>
> condition_iterator:
> [ REVERSE ] expression .. expression [ BY expression ]
>

then you can use second outer for over an array or just while cycle

Reards

Pavel

>
> Thanks again!
> ------------------------------
> songjinzhou (2903807914(at)qq(dot)com)
>
>
> *From:* Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
> *Date:* 2023-01-19 21:04
> *To:* 2903807914(at)qq(dot)com
> *CC:* pgsql-hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>; 1276576182
> <1276576182(at)qq(dot)com>
> *Subject:* Re: Support plpgsql multi-range in conditional control
> Hi
>
>
> čt 19. 1. 2023 v 10:23 odesílatel 2903807914(at)qq(dot)com <2903807914(at)qq(dot)com>
> napsal:
>
>> 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!
>>
>
> I don't like it. The original design of ADA language is to be a safe and
> simple language. Proposed design is in 100% inversion.
>
> What use case it should to support?
>
> Regards
>
> Pavel
>
>
>>
>> ------------------------------
>> 2903807914(at)qq(dot)com
>>
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Takamichi Osumi (Fujitsu) 2023-01-19 16:06:14 RE: Modify the document of Logical Replication configuration settings
Previous Message Robert Haas 2023-01-19 15:45:35 Re: Non-superuser subscription owners