When I don't set the 4th arg, it runs, but we need the 4th argument (the timezone) to get correct data. The query runs correctly in Postgres 16.4.
Relevant log output
sqlc generate failed.
# package
query.sql:3:12: function generate_series(unknown, unknown, unknown, unknown) does not exist
Database schema
N/A
SQL queries
WITH day_sequence AS (
SELECT generate_series(
'2022-11-06T04:00:00Z'::TIMESTAMPTZ,
'2023-11-07T04:59:59.999Z'::TIMESTAMPTZ,
'1 day'::interval,
'America/New_York'
)::TIMESTAMPTZ AS date_value
),
day_groups AS (
SELECT date_value AS calculation_timespan_start,
(date_value + INTERVAL '1 day')::TIMESTAMPTZ AS calculation_timespan_end
FROM day_sequence
)
SELECT calculation_timespan_start,
calculation_timespan_end
FROM day_groups;
Version
1.27.0
What happened?
Postgres 16 added a function overload to
generate_series
with a 4th function arggenerate_series ( start timestamp with time zone, stop timestamp with time zone, step interval [, timezone text ] ) → setof timestamp with time zone
, but it seems to not be recognized by the catalog duringsqlc vet
and fails.When I don't set the 4th arg, it runs, but we need the 4th argument (the timezone) to get correct data. The query runs correctly in Postgres 16.4.
Relevant log output
Database schema
SQL queries
Configuration
Playground URL
https://play.sqlc.dev/p/bd0afb4d9f2671446963689a55ff16bd730a7c4ed17f987d00c69772f2cd54af
What operating system are you using?
macOS
What database engines are you using?
PostgreSQL
What type of code are you generating?
Go