Re:Pg_hint_plan: Force PostgreSQL to execute query plans the...
by IsTom on Saturday March 16, 2024 @06:27AM
(#39724681)
> Psql / pgcli don’t support parameterized queries so you can’t use them to iterate on your hints.
Isn't this what PREPARE and EXECUTE does?
Re:Pg_hint_plan: Force PostgreSQL to execute query plans the...
by feike on Saturday March 16, 2024 @10:13AM
(#39726119)
You should be able nowadays with PG16
INSERT INTO tbl1 VALUES ($1, $2) \bind 'first value' 'second value' \g
https://www.postgresql.org/docs/current/app-psql.html#APP-PS...For older versions, you can do:
\set v_x 'first value'
\set v_y 'second value'
INSERT INTO tbl1 VALUES (:'v_x', :'v_y');
\set v_x 'next value'
INSERT INTO tbl1 VALUES (:'v_x', :'v_y');
Still super useful when you have no other options though.