Extensions

Enhance your SerenDB database with powerful PostgreSQL extensions that add specialized functionality for various use cases.

Overview

PostgreSQL extensions provide additional capabilities beyond the core database features. SerenDB supports a comprehensive set of extensions that enable advanced functionality for AI/ML, geospatial data, full-text search, and more.

  • pgvector: Store and query vector embeddings for AI/ML applications

  • pg_tiktoken: Tokenize text for OpenAI models directly in PostgreSQL

  • pgrag: Retrieval-Augmented Generation capabilities

  • pg_search: Advanced full-text search capabilities

  • pg_trgm: Trigram-based similarity search and fuzzy matching

  • fuzzystrmatch: Phonetic and fuzzy string matching algorithms

Geospatial Data

  • PostGIS: Complete geospatial database functionality

  • PostGIS-related extensions: Additional geospatial tools

  • earthdistance: Calculate great circle distances

Data Types & Structures

  • hstore: Key-value pair storage within PostgreSQL

  • ltree: Hierarchical tree-like structures

  • citext: Case-insensitive text data type

  • uuid-ossp: UUID generation functions

  • pg_uuidv7: Modern UUID v7 support

JSON & Data Processing

  • json/jsonb: Native JSON support (built-in)

  • pg_graphql: GraphQL query interface for PostgreSQL

Performance & Indexing

  • btree_gin: GIN indexing for btree-indexable data types

  • btree_gist: GiST indexing for btree-indexable data types

  • pg_prewarm: Preload relation data into cache

  • pg_stat_statements: Track planning and execution statistics

Time-Series Data

  • TimescaleDB: Optimize PostgreSQL for time-series data

  • pg_mooncake: Time-series data optimization

  • pg_partman: Partition management tools

Database Maintenance

  • pg_repack: Remove bloat without locks

  • pg_cron: Schedule periodic jobs

  • pgstattuple: Tuple-level statistics

Security & Privacy

  • pgcrypto: Cryptographic functions

  • postgresql_anonymizer: Data anonymization and masking

Data Integration

  • dblink: Connect to other PostgreSQL databases

  • postgres_fdw: Foreign data wrapper for remote PostgreSQL

  • wal2json: JSON output for logical replication

Specialized Functions

  • intarray: Specialized array functions for integers

  • cube: Multi-dimensional cube data type

  • tablefunc: Functions that return tables (crosstab, etc.)

  • xml2: XML data type and functions

  • unaccent: Remove accents from strings

  • dict_int: Dictionary template for full-text search

  • pgrowlocks: Row-level locking information

SerenDB-Specific

  • neon: SerenDB-specific utilities and functions

  • neon_utils: Additional SerenDB helper functions

  • online_advisor: Query optimization suggestions

Installing Extensions

Extensions can be installed using the CREATE EXTENSION command:

CREATE EXTENSION IF NOT EXISTS pgvector;

Some extensions are pre-installed and only need to be enabled in your database.

Extension Management

  • Check available extensions: SELECT * FROM pg_available_extensions;

  • View installed extensions: \dx in psql or SELECT * FROM pg_extension;

  • Drop an extension: DROP EXTENSION extension_name;

Best Practices

  1. Only install needed extensions: Each extension adds overhead

  2. Test in branches: Use SerenDB branches to test extensions before production

  3. Check compatibility: Ensure extensions work with your PostgreSQL version

  4. Review documentation: Understand extension-specific configuration options

  5. Monitor performance: Track the impact of extensions on your workload

Getting Started

  1. Check extension-specific documentation for configuration details

  • AI Applications: pgvector, pg_tiktoken, pgrag

  • Full-Text Search: pg_search, pg_trgm

  • Geospatial Applications: PostGIS

  • API Development: pg_graphql

  • Time-Series Analytics: TimescaleDB, pg_mooncake

  • Data Privacy: postgresql_anonymizer, pgcrypto

Explore the extension documentation to unlock advanced PostgreSQL capabilities in your SerenDB database.

Last updated