Docker build of postgresql-9.6 changing the dimension limit for the cube extension, raising it to 2000.
This is needed to be able to work with words embedding with postgres.
You can easily generate a build for your own need in term of dimensions by editing this dockerfile.
The cube extension, which you'll use to perform operations on vectors, has a hard limit of 100 dimensions per vector.
Yup, I managed to do it too. With INSERT
and UPDATE
, the hard limit seems not to be properly checked.
The problem happens (at least) when you try to import a dump. It will fail saying that you can't have vectors with more than 100 dimensions.
If you are using 101+ dimensions vectors with postgres currently, know that you won't be able to restore your backups (and not upgrade postgres if you usually do so through dump/import) :)
The image dockerhub page is here.
To pull it:
docker pull lisitsky/postgres-2kd
I'll tell you that in a few months :)
But patching the hardcoded limit is the recommended way in postgres doc.
Even if you're not familiar with docker, reading the Dockerfile from this repos should be easy enough to teach you how to do it yourself. Spoiler:
- sources are in the
contrib/cube/
directory from postgres sources - limit is in
contrib/cube/cubedata.h
- make and make install should be ran with the
USE_PGXS=true
env variable