Supabase PostgreSQL Image
- supabase/postgres
- Docker 镜像
- 使用 ansible 构建
- ~250MB - 300MB
- 包含大多插件
- 版本号匹配 Postgres
- 基础镜像为 postgres
- Dockerfile
- Vote for Postgres extensions supabase#679
- 扩展
caution
- 目前只有 PG 15
- Supabase with PostgreSQL 16 #19427
# 注意 superuser 为 supabase_admin 密码和 postgres 相同
# 建议登录为 supabase_admin 然后 alter user postgres with superuser
PASSWORD=$(uuidgen | tr -d '[[:space:]]')
docker run --rm -it \
-e POSTGRES_PASSWORD=$PASSWORD \
-p 5432:5432 \
-e POSTGRES_INITDB_ARGS="--encoding=UTF-8 --lc-collate=C --lc-ctype=C" \
-v $PWD/data:/var/lib/postgresql/data \
--name postgres supabase/postgres:15.1.1.58 \
-clisten_addresses="*" \
-cshared_preload_libraries=pg_stat_statements,pg_stat_monitor,pgaudit,plpgsql,plpgsql_check,pg_cron,pg_net,timescaledb,auto_explain,pg_tle
unix_socket_directories = '/var/run/postgresql'
session_preload_libraries = 'supautils'
include = '/etc/postgresql-custom/supautils.conf'
cron.database_name = 'postgres'
pljava.libjvm_location = '/usr/lib/jvm/java-11-openjdk-${TARGETARCH}/lib/server/libjvm.so'
pgsodium.getkey_script= '/usr/lib/postgresql/${postgresql_major}/bin/pgsodium_getkey.sh'
auto_explain.log_min_duration = 10s
Extensions
Extension | Description |
---|---|
Postgres contrib modules | pg_stat_statements |
PostGIS | GIS |
pgRouting | Extension of PostGIS - provides geospatial routing functionalities. |
pgTAP | Unit Testing for Postgres. |
pg_cron | Run CRON jobs inside Postgres. |
pgAudit | Generate highly compliant audit logs. |
pgjwt | Generate JSON Web Tokens (JWT) in Postgres. |
pgsql-http | HTTP client for Postgres. |
plpgsql_check | Linter tool for PL/pgSQL. |
pg-safeupdate | Protect your data from accidental updates or deletes. |
wal2json | JSON output plugin for logical replication decoding. |
PL/Java | PL/Java |
plv8 | PL/Javascript |
pg_plan_filter | Only allow statements that fulfill set criteria to be executed. |
pg_net | Expose the SQL interface for async networking. |
rum | An alternative to the GIN index. |
pg_hashids | Generate unique identifiers from numbers. |
pgsodium | libsodium |
pg_stat_monitor | Query Performance Monitoring |
pgvector | vector similarity search |
pg_repack | Tool to remove bloat from tables and indexes |
pg_jsonschema | |
pg_graphql | |
sfcgal | |
timescaledb | |
vault | |
wrappers | FDW dev kit by Supabase |
pgroonga | |
hypopg | |
pg_tle | trusted language extensions |
supautils | |
plls | PL/LiveScript |
create extension if not exists pg_hashids;
-- id_encode, id_decode
select id_encode(1234567, 'This is my salt', /*min length*/ 10, /* alphabet */ 'abcdefghijABCDxFGHIJ1234567890');
- TLE - Trusted Language Extensions
- tensorchord/pgvecto.rs
- pgvecto.rs #895
- 不是 trusted extension, 使用了 ipc/mmap
- vs pgvector https://docs.pgvecto.rs/faqs/comparison-pgvector.html
- pgvecto.rs #895
FAQ
You might want to create it and/or set "pgsodium.getkey_script" to the correct path.
pgsodium.getkey_script='/usr/lib/postgresql/${postgresql_major}/bin/pgsodium_getkey.sh'