Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pg 16 to CI and remove :generic explain plan option #606

Merged
merged 2 commits into from
May 6, 2024

Conversation

greg-rychlewski
Copy link
Member

I got PG 16 to work on the CI. The issue is we use the image tags 16.0, 11.1, etc. As of Postgres 16 this tries to get the debian image instead of alpine. Appending -alpine to the tag name fixes it. I added it to all the old ones as well so that no one wonders why some have -alpine and some don't, in the future.

At the same time, adding these tests uncovered an issue supporting Postgres's built-in generic option. The issue is we have to send a query with placeholders without sending the actual parameter values. For example we have to send

EXPLAIN (generic_plan) select * from table where field = $1

But if we send the parameter values they will be used in the explain plan. If we don't send the parameter values then we get into issues with Postgrex because it checks to make sure we have the right number of params. We get an error like this

(ArgumentError) parameters must be of length 2 for query %Postgrex.Query{...

I'm not really convinced it's worth digging into the guts of Postgrex just for this one explain option when we already have a workaround. And even if we could alter Postgrex for this case, I'm not sure Postgres will work as we expect. So I am suggesting to remove that option.

@greg-rychlewski greg-rychlewski merged commit 942f8ac into elixir-ecto:master May 6, 2024
10 checks passed
@greg-rychlewski greg-rychlewski deleted the pg16_ci branch May 6, 2024 08:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants