跳至正文
Wener Notes

Supabase PostgreSQL Image

约 2 分钟阅读
bash
# 注意 superuser 为 supabase_admin 密码和 postgres 相同
# 建议登录为 supabase_admin 然后 alter user postgres with superuser
# https://hub.docker.com/r/supabase/postgres
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:17.4.1.071 \
  -clisten_addresses="*" \
  -cshared_preload_libraries=pg_stat_statements,pg_stat_monitor,pgaudit,plpgsql,plpgsql_check,pg_cron,pg_net,timescaledb,auto_explain,pg_tle
ini
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

ExtensionDescription
Postgres contrib modulespg_stat_statements
GIS
pgRoutingExtension of PostGIS - provides geospatial routing functionalities.
pgTAPUnit Testing for Postgres.
Run CRON jobs inside Postgres.
pgAuditGenerate highly compliant audit logs.
Generate JSON Web Tokens (JWT) in Postgres.
HTTP client for Postgres.
Linter tool for PL/pgSQL.
Protect your data from accidental updates or deletes.
JSON output plugin for logical replication decoding.
PL/Java
PL/Javascript
Only allow statements that fulfill set criteria to be executed.
Expose the SQL interface for async networking.
An alternative to the GIN index.
Generate unique identifiers from numbers.
libsodium
Query Performance Monitoring
vector similarity search
Tool to remove bloat from tables and indexes
pg_jsonschema
pg_graphql
sfcgal
timescaledb
vault
FDW dev kit by Supabase
pgroonga
hypopg
trusted language extensions
supautils
pllsPL/LiveScript
sql
create extension if not exists pg_hashids;
-- id_encode, id_decode
select id_encode(1234567, 'This is my salt', /*min length*/ 10, /* alphabet */ 'abcdefghijABCDxFGHIJ1234567890');

FAQ

You might want to create it and/or set "pgsodium.getkey_script" to the correct path.

text
pgsodium.getkey_script='/usr/lib/postgresql/${postgresql_major}/bin/pgsodium_getkey.sh'

关联信息

反向链接、本文链接的其他页面和外部资料。

反向链接

  • 常见问题
    笔记 · supabase

    Errors and Messages · SQL Key Words · case-sentivity of identifiers - 表、列、函数名 · 如果没有双引号,则不区分大小写,默认转换为小写 · https://www.postgresql.org/docs/current/sql-syntax-lexical.html#SQL-SYN...

  • PostgreSQL Awesome
    笔记 · supabase/postgres

    扩展插件功能 · 数据功能 - 数据类型、操作类型、索引类型 · 服务功能 - 集群、cron、存储引擎 · 查询能力 - 图、流、GIS · 集成功能 - Redis、ES · 语言功能 - JS、Lua、Java · neondatabase/neon

参考资料

GitHub23 条
其他外链8 条
最近更新commit 7ae07ca编辑