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

Started by Wen Yialmost 3 years ago4 messagesgeneral
Jump to latest
#1Wen Yi
896634148@qq.com

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

#2Adrian Klaver
adrian.klaver@aklaver.com
In reply to: Wen Yi (#1)
Re: Where I can find the achieve of the 'generate_series' ?

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

#3jian he
jian.universality@gmail.com
In reply to: Wen Yi (#1)
Re: Where I can find the achieve of the 'generate_series' ?

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.

#4Laurenz Albe
laurenz.albe@cybertec.at
In reply to: Wen Yi (#1)
Re: Where I can find the achieve of the 'generate_series' ?

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.(I download 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