From 618ab518500baacc7889d75ab45361aeb9054e87 Mon Sep 17 00:00:00 2001 From: Rafael dos Santos Silva Date: Fri, 9 Aug 2024 11:16:38 -0300 Subject: [PATCH] Update pgvector to 0.7 (#825) * Update pgvector to 0.7 * escape * drop version --- image/discourse_dev/postgres_dev.template.yml | 3 +++ templates/postgres.15.template.yml | 2 ++ templates/postgres.template.yml | 2 ++ 3 files changed, 7 insertions(+) diff --git a/image/discourse_dev/postgres_dev.template.yml b/image/discourse_dev/postgres_dev.template.yml index e30ec54..a981e90 100644 --- a/image/discourse_dev/postgres_dev.template.yml +++ b/image/discourse_dev/postgres_dev.template.yml @@ -29,6 +29,7 @@ run: - exec: su postgres -c 'psql discourse_development -c "create extension if not exists hstore;"' - exec: su postgres -c 'psql discourse_development -c "create extension if not exists pg_trgm;"' - exec: su postgres -c 'psql discourse_development -c "create extension if not exists vector;"' + - exec: su postgres -c 'psql discourse_development -c "alter extension vector update;"' || true - exec: su postgres -c 'createdb discourse_test' || true - exec: su postgres -c 'psql discourse_test -c "grant all privileges on database discourse_test to discourse;"' || true @@ -36,6 +37,7 @@ run: - exec: su postgres -c 'psql discourse_test -c "create extension if not exists hstore;"' - exec: su postgres -c 'psql discourse_test -c "create extension if not exists pg_trgm;"' - exec: su postgres -c 'psql discourse_test -c "create extension if not exists vector;"' + - exec: su postgres -c 'psql discourse_test -c "alter extension vector update;"' || true - exec: su postgres -c 'createdb discourse_test_multisite' || true - exec: su postgres -c 'psql discourse_test_multisite -c "grant all privileges on database discourse_test_multisite to discourse;"' || true @@ -43,6 +45,7 @@ run: - exec: su postgres -c 'psql discourse_test_multisite -c "create extension if not exists hstore;"' - exec: su postgres -c 'psql discourse_test_multisite -c "create extension if not exists pg_trgm;"' - exec: su postgres -c 'psql discourse_test_multisite -c "create extension if not exists vector;"' + - exec: su postgres -c 'psql discourse_test_multisite -c "alter extension vector update;"' || true - exec: cd tmp && git clone https://github.com/discourse/discourse.git --depth=1 - exec: chown -R discourse /tmp/discourse diff --git a/templates/postgres.15.template.yml b/templates/postgres.15.template.yml index 6c7a3b4..e3e1f5e 100644 --- a/templates/postgres.15.template.yml +++ b/templates/postgres.15.template.yml @@ -241,9 +241,11 @@ run: su postgres -c 'psql template1 -c "create extension if not exists hstore;"' su postgres -c 'psql template1 -c "create extension if not exists pg_trgm;"' su postgres -c 'psql template1 -c "create extension if not exists vector;"' + su postgres -c 'psql template1 -c "alter extension vector update;"' || true su postgres -c 'psql $db_name -c "create extension if not exists hstore;"' su postgres -c 'psql $db_name -c "create extension if not exists pg_trgm;"' su postgres -c 'psql $db_name -c "create extension if not exists vector;"' + su postgres -c 'psql $db_name -c "alter extension vector update;"' || true sudo -u postgres psql $db_name <<< "update pg_database set encoding = pg_char_to_encoding('UTF8') where datname = '$db_name' AND encoding = pg_char_to_encoding('SQL_ASCII');" || true - file: diff --git a/templates/postgres.template.yml b/templates/postgres.template.yml index 4b0461d..9aee6be 100644 --- a/templates/postgres.template.yml +++ b/templates/postgres.template.yml @@ -229,9 +229,11 @@ run: su postgres -c 'psql template1 -c "create extension if not exists hstore;"' su postgres -c 'psql template1 -c "create extension if not exists pg_trgm;"' su postgres -c 'psql template1 -c "create extension if not exists vector;"' + su postgres -c 'psql template1 -c "alter extension vector update;"' || true su postgres -c 'psql $db_name -c "create extension if not exists hstore;"' su postgres -c 'psql $db_name -c "create extension if not exists pg_trgm;"' su postgres -c 'psql $db_name -c "create extension if not exists vector;"' + su postgres -c 'psql $db_name -c "alter extension vector update;"' || true sudo -u postgres psql $db_name <<< "update pg_database set encoding = pg_char_to_encoding('UTF8') where datname = '$db_name' AND encoding = pg_char_to_encoding('SQL_ASCII');" || true - file: -- 2.25.1