Initial commit on c10s

Resolves: RHEL-128172
This commit is contained in:
Lukas Javorsky 2025-12-01 14:58:34 +00:00
parent 0122909390
commit 9604bbfb6a
6 changed files with 164 additions and 0 deletions

1
.gitignore vendored
View File

@ -0,0 +1 @@
/v0.8.0.tar.gz

22
2c53c30.patch Normal file
View File

@ -0,0 +1,22 @@
From 2c53c304150e97e224eda93b87e984d946828417 Mon Sep 17 00:00:00 2001
From: Andrew Kane <andrew@ankane.org>
Date: Fri, 10 Jan 2025 08:50:51 -0800
Subject: [PATCH] Fixed compilation error with Postgres 18
---
src/ivfbuild.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/ivfbuild.c b/src/ivfbuild.c
index 54a5be50f..944f07b55 100644
--- a/src/ivfbuild.c
+++ b/src/ivfbuild.c
@@ -360,7 +360,7 @@ InitBuildState(IvfflatBuildState * buildstate, Relation heap, Relation index, In
buildstate->sortdesc = CreateTemplateTupleDesc(3);
TupleDescInitEntry(buildstate->sortdesc, (AttrNumber) 1, "list", INT4OID, -1, 0);
TupleDescInitEntry(buildstate->sortdesc, (AttrNumber) 2, "tid", TIDOID, -1, 0);
- TupleDescInitEntry(buildstate->sortdesc, (AttrNumber) 3, "vector", buildstate->tupdesc->attrs[0].atttypid, -1, 0);
+ TupleDescInitEntry(buildstate->sortdesc, (AttrNumber) 3, "vector", TupleDescAttr(buildstate->tupdesc, 0)->atttypid, -1, 0);
buildstate->slot = MakeSingleTupleTableSlot(buildstate->sortdesc, &TTSOpsVirtual);

40
78ed8f1.patch Normal file
View File

@ -0,0 +1,40 @@
From 78ed8f11576c77a0a6b5fc0ebf721a3dc4f4c954 Mon Sep 17 00:00:00 2001
From: Andrew Kane <andrew@ankane.org>
Date: Mon, 17 Feb 2025 16:38:14 -0800
Subject: [PATCH] Fixed compilation error with Postgres 18 - fixes #779
---
src/hnswvacuum.c | 4 ++++
src/ivfvacuum.c | 4 ++++
2 files changed, 8 insertions(+)
diff --git a/src/hnswvacuum.c b/src/hnswvacuum.c
index 251d9d9ad..2f7b2f372 100644
--- a/src/hnswvacuum.c
+++ b/src/hnswvacuum.c
@@ -9,6 +9,10 @@
#include "storage/lmgr.h"
#include "utils/memutils.h"
+#if PG_VERSION_NUM >= 180000
+#define vacuum_delay_point() vacuum_delay_point(false)
+#endif
+
/*
* Check if deleted list contains an index TID
*/
diff --git a/src/ivfvacuum.c b/src/ivfvacuum.c
index 1272da831..750cdd65a 100644
--- a/src/ivfvacuum.c
+++ b/src/ivfvacuum.c
@@ -5,6 +5,10 @@
#include "ivfflat.h"
#include "storage/bufmgr.h"
+#if PG_VERSION_NUM >= 180000
+#define vacuum_delay_point() vacuum_delay_point(false)
+#endif
+
/*
* Bulk delete tuples from the index
*/

3
README.md Normal file
View File

@ -0,0 +1,3 @@
# postgresql18-pgvector
The postgresql18-pgvector package

View File

@ -0,0 +1,97 @@
%{!?postgresql_default:%global postgresql_default 0}
%global pname vector
%global sname pgvector
%global pgversion 18
%ifarch ppc64 ppc64le s390 s390x armv7hl
%{!?llvm:%global llvm 0}
%else
%{!?llvm:%global llvm 0}
%endif
Name: postgresql%{pgversion}-%{sname}
Version: 0.8.0
Release: 1%{?dist}
Summary: Open-source vector similarity search for Postgres
License: PostgreSQL
URL: https://github.com/%{sname}/%{sname}/
Source0: https://github.com/%{sname}/%{sname}/archive/refs/tags/v%{version}.tar.gz
# Upstream commits for compatiblity with PG18 present on master branch
# not yet included in any tag or release
Patch0: 78ed8f1.patch
Patch1: 2c53c30.patch
%if %?postgresql_default
%global pkgname %{sname}
%package -n %{pkgname}
Summary: Open-source vector similarity search for Postgres
%else
%global pkgname %name
%endif
BuildRequires: make gcc
BuildRequires: postgresql%{pgversion}-server-devel
Requires: postgresql%{pgversion}-server
%global precise_version %{?epoch:%epoch:}%version-%release
%if %?postgresql_default
Provides: postgresql-%{sname} = %precise_version
Provides: %name = %precise_version
%endif
Provides: %{pkgname}%{?_isa} = %precise_version
Provides: %{pkgname} = %precise_version
Provides: %{sname}-any
Conflicts: %{sname}-any
%description
Open-source vector similarity search for Postgres. Supports L2 distance,
inner product, and cosine distance
%description -n %{pkgname}
Open-source vector similarity search for Postgres. Supports L2 distance,
inner product, and cosine distance
%if %llvm
%package -n %{pkgname}-llvmjit
Summary: Just-in-time compilation support for pgvector
Requires: %{pkgname}%{?_isa} = %precise_version
Requires: llvm => 13.0
%description -n %{pkgname}-llvmjit
This packages provides JIT support for pgvector
%endif
%prep
%autosetup -p1 -n %{sname}-%{version}
%build
%make_build %{?_smp_mflags} OPTFLAGS=""
%install
%make_install
#Remove header file, we don't need it right now:
%{__rm} %{buildroot}/%{_includedir}/pgsql/server/extension/%{pname}/%{pname}.h
%{__rm} %{buildroot}/%{_includedir}/pgsql/server/extension/%{pname}/halfvec.h
%{__rm} %{buildroot}/%{_includedir}/pgsql/server/extension/%{pname}/sparsevec.h
%files -n %{pkgname}
%doc README.md
%license LICENSE
%{_libdir}/pgsql/%{pname}.so
%{_datadir}/pgsql/extension//%{pname}.control
%{_datadir}/pgsql/extension/%{pname}*sql
%if %llvm
%files -n %{pkgname}-llvmjit
%{_libdir}/pgsql/bitcode/%{pname}*.bc
%{_libdir}/pgsql/bitcode/%{pname}/src/*.bc
%endif
%changelog
* Mon Dec 01 2025 Lukas Javorsky <ljavorsk@redhat.com> - 0.8.0-1
- Initial commit on c10s
- Resolves: RHEL-128172

1
sources Executable file
View File

@ -0,0 +1 @@
SHA512 (v0.8.0.tar.gz) = 319b0c99607fcd20a6c5503f3ab9559e57c30910522fde701a09e15184b802db6567e5105fb1935a187078c33923eaddf2da0598251a2e03342ec43cd1df7be2