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

feat(compute): Allow installing both 0.8.0 and 0.7.4 pgvector #10345

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ololobus
Copy link
Member

@ololobus ololobus commented Jan 10, 2025

Problem

Both these versions are binary compatible, but the way pgvector structures the SQL files forbids installing 0.7.4 if you have a 0.8.0 distribution. Yet, some users may need a previous version for backward compatibility, e.g., restoring the dump.

See this thread for discussion
https://neondb.slack.com/archives/C04DGM6SMTM/p1735911490242919?thread_ts=1731343604.259169&cid=C04DGM6SMTM

Summary of changes

Put vector--0.7.4.sql file into compute image to allow installing this version as well.

Tested on staging and it seems to be working as expected:

select * from pg_available_extensions where name = 'vector';
  name  | default_version | installed_version |                       comment                        
--------+-----------------+-------------------+------------------------------------------------------
 vector | 0.8.0           | (null)            | vector data type and ivfflat and hnsw access methods

create extension vector version '0.7.4';

select * from pg_available_extensions where name = 'vector';
  name  | default_version | installed_version |                       comment                        
--------+-----------------+-------------------+------------------------------------------------------
 vector | 0.8.0           | 0.7.4             | vector data type and ivfflat and hnsw access methods

alter extension vector update;

select * from pg_available_extensions where name = 'vector';
  name  | default_version | installed_version |                       comment                        
--------+-----------------+-------------------+------------------------------------------------------
 vector | 0.8.0           | 0.8.0             | vector data type and ivfflat and hnsw access methods

drop extension vector;
create extension vector;

select * from pg_available_extensions where name = 'vector';
  name  | default_version | installed_version |                       comment                        
--------+-----------------+-------------------+------------------------------------------------------
 vector | 0.8.0           | 0.8.0             | vector data type and ivfflat and hnsw access methods

If we find out it's a good approach, we can adopt the same for other extensions with a stable ABI -- support both current and current - 1 releases.

@ololobus ololobus force-pushed the alexk/multi-version-pgvector branch from a0e4d37 to d713c04 Compare January 10, 2025 15:17
Both these versions are binary compatible, but the way pgvector
structures the SQL files forbids installing 0.7.4 if you are on 0.8.0.
Yet, some customers may need a previous version for backward
compatibility, e.g. restoring the dump.

See this thread for discussion
https://neondb.slack.com/archives/C04DGM6SMTM/p1735911490242919?thread_ts=1731343604.259169&cid=C04DGM6SMTM

Put `vector--0.7.4.sql` file into compute image to allow installing this
version as well.
@ololobus ololobus force-pushed the alexk/multi-version-pgvector branch from d713c04 to 4991520 Compare January 10, 2025 15:29
@ololobus ololobus marked this pull request as ready for review January 10, 2025 16:21
@ololobus ololobus requested a review from a team as a code owner January 10, 2025 16:21
Copy link

7282 tests run: 6917 passed, 0 failed, 365 skipped (full report)


Flaky tests (1)

Postgres 16

Code coverage* (full report)

  • functions: 32.7% (8042 of 24618 functions)
  • lines: 47.8% (66813 of 139908 lines)

* collected from Rust tests only


The comment gets automatically updated with the latest test results
4991520 at 2025-01-10T16:28:15.102Z :recycle:

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.

1 participant