From ee99798da7aa2c257737af1c3c95dceaa5eb3c4b Mon Sep 17 00:00:00 2001 From: Oliver Sand Date: Wed, 18 Aug 2021 11:19:25 +0200 Subject: [PATCH] Correct version requirements on postgres from 11 to 12 (#6863) Signed-off-by: Oliver Sand --- .changeset/quiet-hornets-yawn.md | 6 ++++++ docs/features/search/search-engines.md | 2 +- plugins/search-backend-module-pg/README.md | 2 +- .../src/database/DatabaseDocumentStore.ts | 8 ++++---- 4 files changed, 12 insertions(+), 6 deletions(-) create mode 100644 .changeset/quiet-hornets-yawn.md diff --git a/.changeset/quiet-hornets-yawn.md b/.changeset/quiet-hornets-yawn.md new file mode 100644 index 0000000000..35a0a7706d --- /dev/null +++ b/.changeset/quiet-hornets-yawn.md @@ -0,0 +1,6 @@ +--- +'@backstage/plugin-search-backend-module-pg': patch +--- + +Correct version requirements on postgres from 11 to 12. Postgres 12 is required +due the use of generated columns. diff --git a/docs/features/search/search-engines.md b/docs/features/search/search-engines.md index 69a223b29e..a0302ce279 100644 --- a/docs/features/search/search-engines.md +++ b/docs/features/search/search-engines.md @@ -43,7 +43,7 @@ provides decent results and performs well with ten thousands of indexed documents. The connection to postgres is established via the database manager also used by other plugins. -> **Important**: The search plugin requires at least Postgres 11! +> **Important**: The search plugin requires at least Postgres 12! To use the `PgSearchEngine`, make sure that you have a Postgres database configured and make the following changes to your backend: diff --git a/plugins/search-backend-module-pg/README.md b/plugins/search-backend-module-pg/README.md index fb9dbccc4a..d3f98132aa 100644 --- a/plugins/search-backend-module-pg/README.md +++ b/plugins/search-backend-module-pg/README.md @@ -8,7 +8,7 @@ well with ten thousands of indexed documents. The connection to postgres is established via the database manager also used by other plugins. -> **Important**: The search plugin requires at least Postgres 11! +> **Important**: The search plugin requires at least Postgres 12! ## Getting started diff --git a/plugins/search-backend-module-pg/src/database/DatabaseDocumentStore.ts b/plugins/search-backend-module-pg/src/database/DatabaseDocumentStore.ts index ecaa3e2f0f..77f15746a6 100644 --- a/plugins/search-backend-module-pg/src/database/DatabaseDocumentStore.ts +++ b/plugins/search-backend-module-pg/src/database/DatabaseDocumentStore.ts @@ -34,18 +34,18 @@ export class DatabaseDocumentStore implements DatabaseStore { try { const majorVersion = await queryPostgresMajorVersion(knex); - if (majorVersion < 11) { + if (majorVersion < 12) { // We are using some features (like generated columns) that aren't // available in older postgres versions. throw new Error( - `The PgSearchEngine requires at least postgres version 11 (but is running on ${majorVersion})`, + `The PgSearchEngine requires at least postgres version 12 (but is running on ${majorVersion})`, ); } } catch { // Actually both mysql and sqlite have a full text search, too. We could // implement them separately or add them here. throw new Error( - 'The PgSearchEngine is only supported when using a postgres database (>=11.x)', + 'The PgSearchEngine is only supported when using a postgres database (>=12.x)', ); } @@ -59,7 +59,7 @@ export class DatabaseDocumentStore implements DatabaseStore { try { const majorVersion = await queryPostgresMajorVersion(knex); - return majorVersion >= 11; + return majorVersion >= 12; } catch { return false; }