From 13d5269038705df2043f98c9c50cc0c6ee3cb8b4 Mon Sep 17 00:00:00 2001 From: Gytis Ivaskevicius Date: Thu, 20 Mar 2025 21:34:21 +0200 Subject: [PATCH 1/2] chore: cleanup flake.nix --- flake.lock | 74 ++-------------------------------- flake.nix | 114 ++++++++++++++++++++++++++--------------------------- 2 files changed, 60 insertions(+), 128 deletions(-) diff --git a/flake.lock b/flake.lock index 2d05388c6..a0c72dcef 100644 --- a/flake.lock +++ b/flake.lock @@ -18,24 +18,6 @@ "type": "github" } }, - "flake-utils_2": { - "inputs": { - "systems": "systems_2" - }, - "locked": { - "lastModified": 1694529238, - "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "ff7b65b44d01cf9ba6a71320833626af21126384", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, "nix-editor": { "inputs": { "nixpkgs": "nixpkgs", @@ -55,25 +37,6 @@ "type": "github" } }, - "nix2container": { - "inputs": { - "flake-utils": "flake-utils_2", - "nixpkgs": "nixpkgs_2" - }, - "locked": { - "lastModified": 1708764364, - "narHash": "sha256-+pOtDvmuVTg0Gi58hKDUyrNla5NbyUvt3Xs3gLR0Fws=", - "owner": "nlewo", - "repo": "nix2container", - "rev": "c891f90d2e3c48a6b33466c96e4851e0fc0cf455", - "type": "github" - }, - "original": { - "owner": "nlewo", - "repo": "nix2container", - "type": "github" - } - }, "nixpkgs": { "locked": { "lastModified": 1675673983, @@ -91,21 +54,6 @@ } }, "nixpkgs_2": { - "locked": { - "lastModified": 1697269602, - "narHash": "sha256-dSzV7Ud+JH4DPVD9od53EgDrxUVQOcSj4KGjggCDVJI=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "9cb540e9c1910d74a7e10736277f6eb9dff51c81", - "type": "github" - }, - "original": { - "owner": "NixOS", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_3": { "locked": { "lastModified": 1712666087, "narHash": "sha256-WwjUkWsjlU8iUImbivlYxNyMB1L5YVqE8QotQdL9jWc=", @@ -121,7 +69,7 @@ "type": "github" } }, - "nixpkgs_4": { + "nixpkgs_3": { "locked": { "lastModified": 1728538411, "narHash": "sha256-f0SBJz1eZ2yOuKUr5CA9BHULGXVSn6miBuUWdTyhUhU=", @@ -141,14 +89,13 @@ "inputs": { "flake-utils": "flake-utils", "nix-editor": "nix-editor", - "nix2container": "nix2container", - "nixpkgs": "nixpkgs_3", + "nixpkgs": "nixpkgs_2", "rust-overlay": "rust-overlay" } }, "rust-overlay": { "inputs": { - "nixpkgs": "nixpkgs_4" + "nixpkgs": "nixpkgs_3" }, "locked": { "lastModified": 1729045942, @@ -179,21 +126,6 @@ "type": "github" } }, - "systems_2": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, "utils": { "locked": { "lastModified": 1667395993, diff --git a/flake.nix b/flake.nix index b36ccda57..677ba4d89 100644 --- a/flake.nix +++ b/flake.nix @@ -4,12 +4,11 @@ inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; flake-utils.url = "github:numtide/flake-utils"; - nix2container.url = "github:nlewo/nix2container"; nix-editor.url = "github:snowfallorg/nix-editor"; rust-overlay.url = "github:oxalica/rust-overlay"; }; - outputs = { self, nixpkgs, flake-utils, nix2container, nix-editor, rust-overlay, ...}: + outputs = { self, nixpkgs, flake-utils, nix-editor, rust-overlay, ...}: let gitRev = "vcs=${self.shortRev or "dirty"}+${builtins.substring 0 8 (self.lastModifiedDate or self.lastModified or "19700101")}"; @@ -23,14 +22,13 @@ let pgsqlDefaultPort = "5435"; pgsqlSuperuser = "supabase_admin"; - nix2img = nix2container.packages.${system}.nix2container; pkgs = import nixpkgs { - config = { + config = { allowUnfree = true; permittedInsecurePackages = [ "v8-9.7.106.18" - ]; + ]; }; inherit system; overlays = [ @@ -151,7 +149,7 @@ # plus the orioledb option #we're not using timescaledb in the orioledb version of supabase extensions orioleFilteredExtensions = builtins.filter ( - x: + x: x != ./nix/ext/timescaledb.nix && x != ./nix/ext/timescaledb-2.9.1.nix && x != ./nix/ext/plv8.nix @@ -197,7 +195,7 @@ }; makeOurPostgresPkgs = version: - let + let postgresql = getPostgresqlPackage version; extensionsToUse = if (builtins.elem version ["orioledb-17"]) then orioledbExtensions @@ -257,7 +255,7 @@ recurseForDerivations = true; }; - makePostgresDevSetup = { pkgs, name, extraSubstitutions ? {} }: + makePostgresDevSetup = { pkgs, name, extraSubstitutions ? {} }: let paths = { migrationsDir = builtins.path { @@ -309,11 +307,11 @@ path = ./nix/tests/util/pgsodium_getkey.sh; }; }; - + localeArchive = if pkgs.stdenv.isDarwin then "${pkgs.darwin.locale}/share/locale" else "${pkgs.glibcLocales}/lib/locale/locale-archive"; - + substitutions = { SHELL_PATH = "${pkgs.bash}/bin/bash"; PGSQL_DEFAULT_PORT = "${pgsqlDefaultPort}"; @@ -336,13 +334,13 @@ PGBOUNCER_AUTH_SCHEMA_SQL = "${paths.pgbouncerAuthSchemaSql}"; STAT_EXTENSION_SQL = "${paths.statExtensionSql}"; CURRENT_SYSTEM = "${system}"; - } // extraSubstitutions; # Merge in any extra substitutions + } // extraSubstitutions; # Merge in any extra substitutions in pkgs.runCommand name { inherit (paths) migrationsDir postgresqlSchemaSql pgbouncerAuthSchemaSql statExtensionSql; } '' set -x mkdir -p $out/bin $out/etc/postgresql-custom $out/etc/postgresql $out/extension-custom-scripts - + # Copy config files with error handling cp ${paths.supautilsConfigFile} $out/etc/postgresql-custom/supautils.conf || { echo "Failed to copy supautils.conf"; exit 1; } cp ${paths.pgconfigFile} $out/etc/postgresql/postgresql.conf || { echo "Failed to copy postgresql.conf"; exit 1; } @@ -351,7 +349,7 @@ cp ${paths.pgHbaConfigFile} $out/etc/postgresql/pg_hba.conf || { echo "Failed to copy pg_hba.conf"; exit 1; } cp ${paths.pgIdentConfigFile} $out/etc/postgresql/pg_ident.conf || { echo "Failed to copy pg_ident.conf"; exit 1; } cp -r ${paths.postgresqlExtensionCustomScriptsPath}/* $out/extension-custom-scripts/ || { echo "Failed to copy custom scripts"; exit 1; } - + echo "Copy operation completed" chmod 644 $out/etc/postgresql-custom/supautils.conf chmod 644 $out/etc/postgresql/postgresql.conf @@ -359,8 +357,8 @@ chmod 644 $out/etc/postgresql/pg_hba.conf substitute ${./nix/tools/run-server.sh.in} $out/bin/start-postgres-server \ - ${builtins.concatStringsSep " " (builtins.attrValues (builtins.mapAttrs - (name: value: "--subst-var-by '${name}' '${value}'") + ${builtins.concatStringsSep " " (builtins.attrValues (builtins.mapAttrs + (name: value: "--subst-var-by '${name}' '${value}'") substitutions ))} chmod +x $out/bin/start-postgres-server @@ -372,7 +370,7 @@ # want. basePackages = let # Function to get the PostgreSQL version from the attribute name - getVersion = name: + getVersion = name: let match = builtins.match "psql_([0-9]+)" name; in @@ -392,32 +390,35 @@ let postgresqlPackage = pkgs."postgresql_${version}"; in - pkgs.callPackage ./nix/ext/pg_regress.nix { + pkgs.callPackage ./nix/ext/pg_regress.nix { postgresql = postgresqlPackage; }; postgresql_15 = getPostgresqlPackage "15"; postgresql_orioledb-17 = getPostgresqlPackage "orioledb-17"; - in + in postgresVersions // { - supabase-groonga = supabase-groonga; - cargo-pgrx_0_11_3 = pkgs.cargo-pgrx.cargo-pgrx_0_11_3; - cargo-pgrx_0_12_6 = pkgs.cargo-pgrx.cargo-pgrx_0_12_6; - cargo-pgrx_0_12_9 = pkgs.cargo-pgrx.cargo-pgrx_0_12_9; + inherit + wal-g + wal-g-2 + wal-g-3 + sfcgal + supabase-groonga + postgresql_15 + postgresql_orioledb-17; + inherit (pkgs.cargo-pgrx) + cargo-pgrx_0_11_3 + cargo-pgrx_0_12_6 + cargo-pgrx_0_12_9; # PostgreSQL versions. - psql_15 = postgresVersions.psql_15; - psql_orioledb-17 = postgresVersions.psql_orioledb-17; - wal-g-2 = wal-g-2; - wal-g-3 = wal-g-3; - sfcgal = sfcgal; + inherit (postgresVersions) + psql_15 + psql_orioledb-17; pg_prove = pkgs.perlPackages.TAPParserSourceHandlerpgTAP; - inherit postgresql_15 postgresql_orioledb-17; postgresql_15_debug = if pkgs.stdenv.isLinux then postgresql_15.debug else null; postgresql_orioledb-17_debug = if pkgs.stdenv.isLinux then postgresql_orioledb-17.debug else null; postgresql_15_src = pkgs.stdenv.mkDerivation { pname = "postgresql-15-src"; - version = postgresql_15.version; - - src = postgresql_15.src; + inherit (postgresql_15) src version; nativeBuildInputs = [ pkgs.bzip2 ]; @@ -437,9 +438,7 @@ }; postgresql_orioledb-17_src = pkgs.stdenv.mkDerivation { pname = "postgresql-17-src"; - version = postgresql_orioledb-17.version; - - src = postgresql_orioledb-17.src; + inherit (postgresql_orioledb-17) src version; nativeBuildInputs = [ pkgs.bzip2 ]; @@ -523,7 +522,7 @@ chmod +x $out/bin/pg-restore ''; sync-exts-versions = pkgs.runCommand "sync-exts-versions" { } '' - mkdir -p $out/bin + mkdir -p $out/bin substitute ${./nix/tools/sync-exts-versions.sh.in} $out/bin/sync-exts-versions \ --subst-var-by 'YQ' '${pkgs.yq}/bin/yq' \ --subst-var-by 'JQ' '${pkgs.jq}/bin/jq' \ @@ -538,7 +537,7 @@ substitute ${./nix/tools/local-infra-bootstrap.sh.in} $out/bin/local-infra-bootstrap chmod +x $out/bin/local-infra-bootstrap ''; - dbmate-tool = + dbmate-tool = let migrationsDir = ./migrations/db; ansibleVars = ./ansible/vars.yml; @@ -557,7 +556,7 @@ makeWrapper ]; } '' - mkdir -p $out/bin $out/migrations + mkdir -p $out/bin $out/migrations cp -r ${migrationsDir}/* $out substitute ${./nix/tools/dbmate-tool.sh.in} $out/bin/dbmate-tool \ --subst-var-by 'PGSQL_DEFAULT_PORT' '${pgsqlDefaultPort}' \ @@ -604,6 +603,7 @@ makeCheckHarness = pgpkg: let + # TODO: None of these tests are used sqlTests = ./nix/tests/smoke; pg_prove = pkgs.perlPackages.TAPParserSourceHandlerpgTAP; pg_regress = basePackages.pg_regress; @@ -614,22 +614,22 @@ cat > $out/bin/pgsodium-getkey << 'EOF' #!${pkgs.bash}/bin/bash set -euo pipefail - + TMPDIR_BASE=$(mktemp -d) - + if [[ "$(uname)" == "Darwin" ]]; then KEY_DIR="/private/tmp/pgsodium" else KEY_DIR="''${PGSODIUM_KEY_DIR:-$TMPDIR_BASE/pgsodium}" fi KEY_FILE="$KEY_DIR/pgsodium.key" - + if ! mkdir -p "$KEY_DIR" 2>/dev/null; then echo "Error: Could not create key directory $KEY_DIR" >&2 exit 1 fi chmod 1777 "$KEY_DIR" - + if [[ ! -f "$KEY_FILE" ]]; then if ! (dd if=/dev/urandom bs=32 count=1 2>/dev/null | od -A n -t x1 | tr -d ' \n' > "$KEY_FILE"); then if ! (openssl rand -hex 32 > "$KEY_FILE"); then @@ -639,7 +639,7 @@ fi chmod 644 "$KEY_FILE" fi - + if [[ -f "$KEY_FILE" && -r "$KEY_FILE" ]]; then cat "$KEY_FILE" else @@ -675,7 +675,7 @@ isValidFile = name: let isVersionSpecific = builtins.match "z_([0-9]+)_.*" name != null; - matchesVersion = + matchesVersion = if isVersionSpecific then builtins.match ("z_" + version + "_.*") name != null else true; @@ -685,16 +685,16 @@ pkgs.lib.filterAttrs (name: _: isValidFile name) files; # Get the major version for filtering - majorVersion = - if builtins.match ".*17.*" pgpkg.version != null + majorVersion = + if builtins.match ".*17.*" pgpkg.version != null then "17" else "15"; # Filter SQL test files filteredSqlTests = filterTestFiles majorVersion ./nix/tests/sql; - + # Convert filtered tests to a sorted list of basenames (without extension) - testList = pkgs.lib.mapAttrsToList (name: _: + testList = pkgs.lib.mapAttrsToList (name: _: builtins.substring 0 (pkgs.lib.stringLength name - 4) name ) filteredSqlTests; sortedTestList = builtins.sort (a: b: a < b) testList; @@ -702,7 +702,7 @@ in pkgs.runCommand "postgres-${pgpkg.version}-check-harness" { - nativeBuildInputs = with pkgs; [ + nativeBuildInputs = with pkgs; [ coreutils bash perl pgpkg pg_prove pg_regress procps start-postgres-server-bin which getkey-script supabase-groonga ]; @@ -737,12 +737,12 @@ # PostgreSQL startup if [[ "$(uname)" == "Darwin" ]]; then - pg_ctl -D "$PGTAP_CLUSTER" -l "$PGTAP_CLUSTER"/postgresql.log -o "-k "$PGTAP_CLUSTER" -p 5435 -d 5" start 2>&1 + pg_ctl -D "$PGTAP_CLUSTER" -l "$PGTAP_CLUSTER"/postgresql.log -o "-k "$PGTAP_CLUSTER" -p 5435 -d 5" start 2>&1 else mkdir -p "$PGTAP_CLUSTER/sockets" - pg_ctl -D "$PGTAP_CLUSTER" -l "$PGTAP_CLUSTER"/postgresql.log -o "-k $PGTAP_CLUSTER/sockets -p 5435 -d 5" start 2>&1 + pg_ctl -D "$PGTAP_CLUSTER" -l "$PGTAP_CLUSTER"/postgresql.log -o "-k $PGTAP_CLUSTER/sockets -p 5435 -d 5" start 2>&1 fi || { - echo "pg_ctl failed to start PostgreSQL" + echo "pg_ctl failed to start PostgreSQL" echo "Contents of postgresql.log:" cat "$PGTAP_CLUSTER"/postgresql.log exit 1 @@ -776,10 +776,10 @@ rm -rf "$SORTED_DIR" pg_ctl -D "$PGTAP_CLUSTER" stop rm -rf $PGTAP_CLUSTER - + # End of pgtap tests # from here on out we are running pg_regress tests, we use a different cluster for this - # which is start by the start-postgres-server-bin script + # which is start by the start-postgres-server-bin script # start-postgres-server-bin script closely matches our AMI setup, configurations and migrations # Ensure pgsodium key directory exists with proper permissions @@ -789,7 +789,7 @@ fi unset GRN_PLUGINS_DIR ${start-postgres-server-bin}/bin/start-postgres-server ${getVersionArg pgpkg} --daemonize - + for i in {1..60}; do if pg_isready -h localhost -p 5435 -U supabase_admin -q; then echo "PostgreSQL is ready" @@ -827,9 +827,9 @@ cp "$logfile" $out/postgresql.log done exit 0 - ''; + ''; in - rec { + { # The list of all packages that can be built with 'nix build'. The list # of names that can be used can be shown with 'nix flake show' packages = flake-utils.lib.flattenTree basePackages // { @@ -918,7 +918,7 @@ pgrxVersion = "0_12_6"; rustVersion = "1.80.0"; }; - }; + }; } ); } From c85efc2442c25ddf50b40c963fb68339f6e10cd9 Mon Sep 17 00:00:00 2001 From: Gytis Ivaskevicius Date: Fri, 21 Mar 2025 18:50:26 +0200 Subject: [PATCH 2/2] chore: remove unused smoke tests --- flake.nix | 2 - nix/tests/smoke/0000-hello-world.sql | 10 ---- nix/tests/smoke/0001-pg_graphql.sql | 59 -------------------- nix/tests/smoke/0002-supautils.sql | 17 ------ nix/tests/smoke/0003-pgsodium-vault.sql | 40 ------------- nix/tests/smoke/0004-index_advisor.sql | 19 ------- nix/tests/smoke/0005-test_pgroonga_mecab.sql | 36 ------------ 7 files changed, 183 deletions(-) delete mode 100644 nix/tests/smoke/0000-hello-world.sql delete mode 100644 nix/tests/smoke/0001-pg_graphql.sql delete mode 100644 nix/tests/smoke/0002-supautils.sql delete mode 100644 nix/tests/smoke/0003-pgsodium-vault.sql delete mode 100644 nix/tests/smoke/0004-index_advisor.sql delete mode 100644 nix/tests/smoke/0005-test_pgroonga_mecab.sql diff --git a/flake.nix b/flake.nix index 677ba4d89..278e8509f 100644 --- a/flake.nix +++ b/flake.nix @@ -603,8 +603,6 @@ makeCheckHarness = pgpkg: let - # TODO: None of these tests are used - sqlTests = ./nix/tests/smoke; pg_prove = pkgs.perlPackages.TAPParserSourceHandlerpgTAP; pg_regress = basePackages.pg_regress; getkey-script = pkgs.stdenv.mkDerivation { diff --git a/nix/tests/smoke/0000-hello-world.sql b/nix/tests/smoke/0000-hello-world.sql deleted file mode 100644 index d6f002dec..000000000 --- a/nix/tests/smoke/0000-hello-world.sql +++ /dev/null @@ -1,10 +0,0 @@ --- Start transaction and plan the tests. -BEGIN; -SELECT plan(1); - --- Run the tests. -SELECT pass( 'My test passed, w00t!' ); - --- Finish the tests and clean up. -SELECT * FROM finish(); -ROLLBACK; diff --git a/nix/tests/smoke/0001-pg_graphql.sql b/nix/tests/smoke/0001-pg_graphql.sql deleted file mode 100644 index 80e3cb208..000000000 --- a/nix/tests/smoke/0001-pg_graphql.sql +++ /dev/null @@ -1,59 +0,0 @@ --- Start transaction and plan the tests. -begin; - select plan(1); - - create extension if not exists pg_graphql; - - create table account( - id int primary key, - is_verified bool, - name text, - phone text - ); - - insert into public.account(id, is_verified, name, phone) - values - (1, true, 'foo', '1111111111'), - (2, true, 'bar', null), - (3, false, 'baz', '33333333333'); - - select is( - graphql.resolve($$ - { - accountCollection { - edges { - node { - id - } - } - } - } - $$), - '{ - "data": { - "accountCollection": { - "edges": [ - { - "node": { - "id": 1 - } - }, - { - "node": { - "id": 2 - } - }, - { - "node": { - "id": 3 - } - } - ] - } - } - }'::jsonb - ); - - - select * from finish(); -rollback; diff --git a/nix/tests/smoke/0002-supautils.sql b/nix/tests/smoke/0002-supautils.sql deleted file mode 100644 index 7a2160639..000000000 --- a/nix/tests/smoke/0002-supautils.sql +++ /dev/null @@ -1,17 +0,0 @@ -BEGIN; -SELECT plan(2); - --- the setting doesn't exist when supautils is not loaded -SELECT throws_ok($$ - select current_setting('supautils.privileged_extensions', false) -$$); - -LOAD 'supautils'; - --- now it does -SELECT ok( - current_setting('supautils.privileged_extensions', false) = '' -); - -SELECT * FROM finish(); -ROLLBACK; diff --git a/nix/tests/smoke/0003-pgsodium-vault.sql b/nix/tests/smoke/0003-pgsodium-vault.sql deleted file mode 100644 index 1c9cedf91..000000000 --- a/nix/tests/smoke/0003-pgsodium-vault.sql +++ /dev/null @@ -1,40 +0,0 @@ -BEGIN; - -select plan(3); - -select id as test_new_key_id from pgsodium.create_key(name:='test_new_key') \gset - -select vault.create_secret ( - 's3kr3t_k3y', 'a_name', 'this is the foo secret key') test_secret_id \gset - -select vault.create_secret ( - 's3kr3t_k3y_2', 'another_name', 'this is another foo key', - (select id from pgsodium.key where name = 'test_new_key')) test_secret_id_2 \gset - -SELECT results_eq( - $$ - SELECT decrypted_secret = 's3kr3t_k3y', description = 'this is the foo secret key' - FROM vault.decrypted_secrets WHERE name = 'a_name'; - $$, - $$VALUES (true, true)$$, - 'can select from masking view with custom key'); - -SELECT results_eq( - $$ - SELECT decrypted_secret = 's3kr3t_k3y_2', description = 'this is another foo key' - FROM vault.decrypted_secrets WHERE key_id = (select id from pgsodium.key where name = 'test_new_key'); - $$, - $$VALUES (true, true)$$, - 'can select from masking view'); - -SELECT lives_ok( - format($test$ - select vault.update_secret( - %L::uuid, new_name:='a_new_name', - new_secret:='new_s3kr3t_k3y', new_description:='this is the bar key') - $test$, :'test_secret_id'), - 'can update name, secret and description' - ); - -SELECT * FROM finish(); -ROLLBACK; diff --git a/nix/tests/smoke/0004-index_advisor.sql b/nix/tests/smoke/0004-index_advisor.sql deleted file mode 100644 index 53170f6a3..000000000 --- a/nix/tests/smoke/0004-index_advisor.sql +++ /dev/null @@ -1,19 +0,0 @@ --- Start transaction and plan the tests. -begin; - select plan(1); - - create extension if not exists index_advisor; - - create table account( - id int primary key, - is_verified bool - ); - - select is( - (select count(1) from index_advisor('select id from public.account where is_verified;'))::int, - 1, - 'index_advisor returns 1 row' - ); - - select * from finish(); -rollback; diff --git a/nix/tests/smoke/0005-test_pgroonga_mecab.sql b/nix/tests/smoke/0005-test_pgroonga_mecab.sql deleted file mode 100644 index 7341d5f6f..000000000 --- a/nix/tests/smoke/0005-test_pgroonga_mecab.sql +++ /dev/null @@ -1,36 +0,0 @@ --- File: 0005-test_pgroonga_revised.sql - -begin; - -- Plan for 3 tests: extension, table, and index - select plan(3); - - -- Create the PGroonga extension - create extension if not exists pgroonga; - - -- -- Test 1: Check if PGroonga extension exists - select has_extension('pgroonga', 'The pgroonga extension should exist.'); - - -- Create the table - create table notes( - id integer primary key, - content text - ); - - -- Test 2: Check if the table was created - SELECT has_table('public', 'notes', 'The notes table should exist.'); - -- Create the PGroonga index - CREATE INDEX pgroonga_content_index - ON notes - USING pgroonga (content) - WITH (tokenizer='TokenMecab'); - - -- -- Test 3: Check if the index was created - SELECT has_index('public', 'notes', 'pgroonga_content_index', 'The pgroonga_content_index should exist.'); - - -- -- Cleanup (this won't affect the test results as they've already been checked) - DROP INDEX IF EXISTS pgroonga_content_index; - DROP TABLE IF EXISTS notes; - - -- Finish the test plan - select * from finish(); -rollback; \ No newline at end of file