Skip to content

Conversation

@josep-tecnativa
Copy link
Contributor

This PR installs postgresql-pgvector in the image and allows enabling the extension at cluster init.
Fixes Tecnativa/doodba#677

@pedrobaeza
Copy link
Member

What is the cost in build times of adding this?

@josep-tecnativa
Copy link
Contributor Author

For PG ≥ 12 (where the package is available), I’ve been testing locally and the build is ~2–5 seconds slower compared to not installing it. For PG 11 the package is skipped, so there is no extra cost.

@josep-tecnativa
Copy link
Contributor Author

Another option would be to control this with an environment variable (e.g. WITH_PGVECTOR=1). Then, in doodba-copier-template we could enable this variable automatically only for Odoo ≥ 19, while still keeping it optional for those deployments (so even on Odoo 19 it could be disabled if not required).

@pedrobaeza
Copy link
Member

OK, it's not too much then.

@josep-tecnativa josep-tecnativa merged commit 4b63f77 into master Sep 29, 2025
10 checks passed
@JordiMForgeFlow
Copy link
Contributor

@josep-tecnativa @pedrobaeza have these changes been added to the 17-alpine tag?

@josep-tecnativa
Copy link
Contributor Author

Hi @JordiMForgeFlow , yes this changes are already added on the 17-apline latest tag

@JordiMForgeFlow
Copy link
Contributor

JordiMForgeFlow commented Oct 23, 2025

@josep-tecnativa then I am missing something, I still get the error when I try to install AI module. I am using the doodba copier template, is there any other configuration needed besides of what comes by default?

@josep-tecnativa
Copy link
Contributor Author

maybe you have not pulled and built the latest image

@JordiMForgeFlow
Copy link
Contributor

@josep-tecnativa yes, I have the latest one (I compared the digest). I tried also removing the existing volumes and even with a fresh doodba 19 but I still got the error.

@JordiMForgeFlow
Copy link
Contributor

@josep-tecnativa I have been doing some more digging here, and I have seen that (at least in my case) the problem is that the vector extension files are stored in /usr/share/postgresql/extension inside the container, but when you want to create the extension the files are trying to be found under /usr/local/share/postgresql/extension

@JordiMForgeFlow
Copy link
Contributor

@josep-tecnativa the way I have been able to fix it is by adding this to the RUN commands:

&& cp /usr/share/postgresql/extension/vector* /usr/local/share/postgresql/extension/
&& cp /usr/lib/postgresql17/vector.so /usr/local/lib/postgresql/ \

@josep-tecnativa
Copy link
Contributor Author

Great! Could you please, open a PR to apply this fix @JordiMForgeFlow ?

@JordiMForgeFlow
Copy link
Contributor

PR opened in #27

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.

Add support for PostgreSQL pgvector extension

4 participants