Skip to main content
Question

generate_series

  • May 1, 2024
  • 3 replies
  • 7 views

Sergey_Cherepan_1
Forum|alt.badge.img+2

Hi,

I can see schema pg_catalog in Vertica since 12.0, and I can see UDF Transform generate_series there.
But I do not see generate_series mentioned in docs.
And I cannot make generate_series working.

Can you post any example how I can use it.

Thank you
Sergey

3 replies

SruthiA
Forum|alt.badge.img+1
  • Participating Frequently
  • May 1, 2024

you need to use over clause to get it working. please find sample below

test=> SET SEARCH_PATH TO pg_catalog;
SET
test=> select generate_series(1,10) over();

generate_series

           1
           2
           3
           4
           5
           6
           7
           8
           9
          10

(10 rows)


Sergey_Cherepan_1
Forum|alt.badge.img+2

It is definitely something wrong with pg_catalog.generate_series function.

Function should be callable by prefixing with schema name like pg_catalog.generate_series. And it is not. But it works if search path is set.

It is definitely a bug. Please file ticket with engineering.

dev=> select pg_catalog.generate_series(1,10) over();
ERROR 3457: Function pg_catalog.generate_series(int, int) does not exist, or permission is denied for pg_catalog.generate_series(int, int)
HINT: No function matches the given name and argument types. You may need to add explicit type casts
dev=>
dev=>
dev=> set search_path to pg_catalog;
SET
dev=> select pg_catalog.generate_series(1,10) over();

generate_series

           1
           2
           3
           4
           5
           6
           7
           8
           9
          10

(10 rows)

dev=>


SruthiA
Forum|alt.badge.img+1
  • Participating Frequently
  • May 3, 2024

Sure. I have filed a JIRA with engineering.