@@ -26,38 +26,42 @@ HNSW (Hierarchical Navigating Small World) is a graph-based indexing algorithm c
2626== Installation
2727[TIP]
2828====
29- The IvorySQL 4. 5(above version) has been installed in the environment, and the installation path is /usr/local/ivorysql/ivorysql-4
29+ The IvorySQL 5(above version) has been installed in the environment, and the installation path is /usr/local/ivorysql/ivorysql-5
3030====
3131
3232=== Source Code Installation
3333
3434** Setting PG_CONFIG
35- ```
36- export PG_CONFIG=/usr/local/ivorysql/ivorysql-4/bin/pg_config
37- ```
35+ [literal]
36+ ----
37+ export PG_CONFIG=/usr/local/ivorysql/ivorysql-5/bin/pg_config
38+ ----
3839
3940** Pull pg_vector source code
40- ```
41- git clone --branch v0.6.2 https://github.com/pgvector/pgvector.git
42- ```
41+ [literal]
42+ ----
43+ git clone --branch v0.8.1 https://github.com/pgvector/pgvector.git
44+ ----
4345
4446** Install pgvector
45- ```
47+ [literal]
48+ ----
4649cd pgvector
4750
4851sudo --preserve-env=PG_CONFIG make
4952sudo --preserve-env=PG_CONFIG make install
50- ```
53+ ----
5154
5255** Create pgvector extension
53- ```
56+ [literal]
57+ ----
5458[ivorysql@localhost ivorysql-4]$ psql
55- psql (17.5 )
59+ psql (18.0 )
5660Type "help" for help.
5761
5862ivorysql=# create extension vector;
5963CREATE EXTENSION
60- ```
64+ ----
6165Now, pgvector is installed completely.
6266For more usage cases, please refer to https://github.com/pgvector/pgvector?tab=readme-ov-file#getting-started[pgvector document]
6367
@@ -68,7 +72,8 @@ We suggest users to test using port 1521, using the command: psql -p 1521.
6872
6973=== Data Type
7074
71- ```
75+ [literal]
76+ ----
7277ivorysql=# CREATE TABLE items5 (id bigserial PRIMARY KEY, name varchar2(20), num number(20), embedding bit(3));
7378CREATE TABLE
7479ivorysql=# INSERT INTO items5 (name, num, embedding) VALUES ('1st oracle data',0, '000'), ('2nd oracle data', 111, '111');
@@ -78,11 +83,12 @@ ivorysql=# SELECT * FROM items5 ORDER BY bit_count(embedding # '101') LIMIT 5;
7883----+-----------------+-----+-----------
7984 2 | 2nd oracle data | 111 | 111
8085 1 | 1st oracle data | 0 | 000
81- ```
86+ ----
8287
8388=== Anonymous Block
8489
85- ```
90+ [literal]
91+ ----
8692ivorysql=# declare
8793i vector(3) := '[1,2,3]';
8894begin
9197ivorysql-# /
9298NOTICE: [1,2,3]
9399DO
94- ```
100+ ----
95101
96102=== PROCEDURE
97- ```
103+ [literal]
104+ ----
98105ivorysql=# CREATE OR REPLACE PROCEDURE ora_procedure()
99106AS
100107p vector(3) := '[4,5,6]';
@@ -106,10 +113,11 @@ CREATE PROCEDURE
106113ivorysql=# call ora_procedure();
107114NOTICE: [4,5,6]
108115CALL
109- ```
116+ ----
110117
111118==== FUNCTION
112- ```
119+ [literal]
120+ ----
113121ivorysql=# CREATE OR REPLACE FUNCTION AddVector(a vector(3), b vector(3))
114122RETURN vector(3)
115123IS
@@ -123,4 +131,4 @@ ivorysql=# SELECT AddVector('[1,2,3]','[4,5,6]') FROM DUAL;
123131----------------
124132 [5,7,9]
125133(1 row)
126- ```
134+ ----
0 commit comments