Skip to main content

Overview

Metadb provides built-in system functions that return information about the database system, logs, and current processes. These functions are available in the public schema and can be called from any connection.

System Information

Get version information and user lists

Monitoring

Monitor logs and running processes

Function Categories

System Information

Functions that return metadata about the Metadb installation:
  • mdbversion() - Returns the current Metadb version
  • mdbusers() - Lists all registered users

Monitoring Functions

Functions for monitoring system health and activity:
  • mdblog(interval) - Retrieves recent log messages
  • ps() - Shows currently running queries and their status

Usage Patterns

All system functions can be queried using standard SQL SELECT statements:
-- Simple scalar function
select mdbversion();

-- Table-valued function
select * from mdbusers();

-- With filtering
select * from ps() where state = 'active';

Return Types

Metadb functions return either:
Functions like mdbversion() return a single value (text, number, etc.).
select mdbversion();
-- Returns: '1.2.0'
Functions like mdblog() and ps() return tables with multiple rows and columns.
select * from mdblog('1 hour');
-- Returns table with log_time, error_severity, message columns
System functions are read-only and do not modify database state.

Next Steps

System Info Functions

Learn about version and user functions

Monitoring Functions

Learn about log and process monitoring

System Tables

Explore system metadata tables

Build docs developers (and LLMs) love