PostgreSQL Extensions for Testing
This directory contains PostgreSQL extensions used primarily for:
- Testing extension upgrades between different Compute versions
- Running regression tests with regular users (mostly for cloud instances)
Directory Structure
Each extension directory follows a standard structure:
extension-name-src/- Directory containing test files for the extensiontest-upgrade.sh- Script for testing upgrade scenariosregular-test.sh- Script for testing with regular users- Additional test files depending on the extension
Available Extensions
This directory includes the following extensions:
hll-src- HyperLogLog, a fixed-size data structure for approximating cardinalityhypopg-src- Extension to create hypothetical indexesip4r-src- IPv4/v6 and subnet data typespg_cron-src- Run periodic jobs in PostgreSQLpg_graphql-src- GraphQL support for PostgreSQLpg_hint_plan-src- Execution plan hintspg_ivm-src- Incremental view maintenancepg_jsonschema-src- JSON Schema validationpg_repack-src- Reorganize tables with minimal lockspg_roaringbitmap-src- Roaring bitmap implementationpg_semver-src- Semantic version data typepg_session_jwt-src- JWT authentication for PostgreSQLpg_tiktoken-src- OpenAI Tiktoken tokenizerpg_uuidv7-src- UUIDv7 implementation for PostgreSQLpgjwt-src- JWT tokens for PostgreSQLpgrag-src- Retrieval Augmented Generation for PostgreSQLpgtap-src- Unit testing framework for PostgreSQLpgvector-src- Vector similarity searchpgx_ulid-src- ULID data typeplv8-src- JavaScript language for PostgreSQL stored procedurespostgresql-unit-src- SI units for PostgreSQLprefix-src- Prefix matching for stringsrag_bge_small_en_v15-src- BGE embedding model for RAGrag_jina_reranker_v1_tiny_en-src- Jina reranker model for RAGrum-src- RUM access method for text search
Usage
Extension Upgrade Testing
The extensions in this directory are used by the test_extensions_upgrade.sh script to test upgrading extensions between different versions of Neon Compute nodes. The script:
- Creates a database with extensions installed on an old Compute version
- Creates timelines for each extension
- Switches to a new Compute version and tests the upgrade process
- Verifies extension functionality after upgrade
Regular User Testing
For testing with regular users (particularly for cloud instances), each extension directory typically contains a regular-test.sh script that:
- Creates a test database
- Installs the extension
- Runs regression tests
A note about pg_regress: Since pg_regress attempts to set lc_messages for the database by default (which can cause issues), we create databases manually and use the --use-existing option to bypass this limitation.
CI Workflows
Two main workflows use these extensions:
- Cloud Extensions Test - Tests extensions on Neon cloud projects
- Force Test Upgrading of Extension - Tests upgrading extensions between different Compute versions
Adding New Extensions
To add a new extension for testing:
- Create a directory named
extension-name-srcin this directory - Add at minimum:
test-upgrade.shfor upgrade testingregular-test.shfor regular user testing
- Update the list of extensions in the
test_extensions_upgrade.shscript if needed