-
Notifications
You must be signed in to change notification settings - Fork 968
Closed
Labels
📚 postgresql💻 windows🔧 golangbugSomething isn't workingSomething isn't workingquestionFurther information is requestedFurther information is requested
Description
Version
1.17.2
What happened?
WITH new_promo AS (
INSERT INTO promotion (name, description, start_date, end_date)
VALUES ($1, $2, $3, $4)
RETURNING id
), new_promo_configs AS (
INSERT INTO promotion_config (product_id, promotion_id, pd_start_date, pd_end_date)
SELECT unnest(@product_id::BIGINT[]), (SELECT id FROM new_promo), $6, $7
)
RETURNING * ;
this doesn't work , it return
db/queries/createpromo.sql:1:1: could not determine data type of parameter $5
make: *** [Makefile:17: sqlc] Error 1
WITH new_promo AS (
INSERT INTO promotion (name, description, start_date, end_date)
VALUES ($1, $2, $3, $4)
RETURNING id
), new_promo_configs AS (
INSERT INTO promotion_config (product_id, promotion_id, pd_start_date, pd_end_date)
SELECT unnest($5::BIGINT[]), (SELECT id FROM new_promo), $6, $7
)
RETURNING * ;
this works, but return column5
if you have a more complicated query like above , then @ and sqlc,arg does not work
Relevant log output
db/queries/createpromo.sql:1:1: could not determine data type of parameter $5
make: *** [Makefile:17: sqlc] Error 1Database schema
No response
SQL queries
No response
Configuration
No response
Playground URL
No response
What operating system are you using?
Windows
What database engines are you using?
PostgreSQL
What type of code are you generating?
Go
Metadata
Metadata
Assignees
Labels
📚 postgresql💻 windows🔧 golangbugSomething isn't workingSomething isn't workingquestionFurther information is requestedFurther information is requested