Thread: Where I can find the achieve of the 'generate_series' ?

Where I can find the achieve of the 'generate_series' ?

From
"Wen Yi"
Date:
Hi team,
I want to figure out the principle of the function 'generate_series', but I don't know it contains in which source file.(I download the pgsql 15.3 source code)
Can someone provide some advice?
Thanks in advance!

Yours,
Wen Yi

Re: Where I can find the achieve of the 'generate_series' ?

From
Adrian Klaver
Date:
On 5/29/23 17:34, Wen Yi wrote:
> Hi team,
> I want to figure out the principle of the function 'generate_series', 
> but I don't know it contains in which source file.(I download the pgsql 
> 15.3 source code)
> Can someone provide some advice?
> Thanks in advance!
> 

At ~src/

grep -r --include=*.c generate_series

> Yours,
> Wen Yi

-- 
Adrian Klaver
adrian.klaver@aklaver.com




Re: Where I can find the achieve of the 'generate_series' ?

From
jian he
Date:


On Tue, May 30, 2023 at 8:35 AM Wen Yi <896634148@qq.com> wrote:
Hi team,
I want to figure out the principle of the function 'generate_series', but I don't know it contains in which source file.(I download the pgsql 15.3 source code)
Can someone provide some advice?
Thanks in advance!

Yours,
Wen Yi


select proname,prosrc,prosupport from pg_proc where proname  ~* 'generate_series';

then grep the prosrc.

Re: Where I can find the achieve of the 'generate_series' ?

From
Laurenz Albe
Date:
On Tue, 2023-05-30 at 08:34 +0800, Wen Yi wrote:
> I want to figure out the principle of the function 'generate_series', but I don't know it contains in which source
file.(Idownload the pgsql 15.3 source code) 
> Can someone provide some advice?


https://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f=src/backend/utils/adt/int.c;h=44d1c7ad0c4d770acc33f35bb57080bac7670e5c;hb=HEAD#l1499

This is the "integer" version of the function, the others are in
"int8.c", "numeric.c" and "timestamp.c".

Yours,
Laurenz Albe