Based on the documentation, I expected the first planned query text to
be: `SELECT 10 AS data`, since it should be a custom plan with
substituted values. However, the query text always contains a parameter
symbol: `SELECT $1 AS data`.
A query plan is not the same as the query text. While the executed plan can be generic or custom the query text is constant.
If you want to see the difference between a generic and a custom plan you need to comprise a query that would actually have different custom and generic plans. Queries that don’t involve tables, indexes, or joins don’t have any choices to make with respect to how they are executed.
David J.