You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Inferring columns from some CTE's is invalid #4198
WITH w_pending_sale_status as (
select*from
(values ('SAVED'), ('IDLE'), ('IN PROGRESS'), ('HELD'))
as pending_sale_status(status)
)
SELECT status FROM w_pending_sale_status;
Once generated the go file's sql is this
WITH w_pending_sale_status as (
selectfrom
(values ('SAVED'), ('IDLE'), ('IN PROGRESS'), ('HELD'))
as pending_sale_status(status)
)
SELECT status FROM w_pending_sale_status;
Notice it is missing the * so that the error when execting from postgres is column status is not a valid column name
Relevant log output
NA
Database schema
SQL queries
-- name: SaleStatus :many
WITH w_pending_sale_status as (
select*from
(values ('SAVED'), ('IDLE'), ('IN PROGRESS'), ('HELD'))
as pending_sale_status(status)
)
SELECT status FROM w_pending_sale_status;
WITH w_pending_sale_status as (
select unnest(ARRAY['SAVED', 'IDLE', 'IN PROGRESS', 'HELD'])::textas status
)
SELECT status FROM w_pending_sale_status;
Activity
blanchardglen commentedon Dec 1, 2025
A workaround for now is to use this CTE instead