Skip to content

This is the multi-page printable view of this section.

Return to the regular view of this page

Reference

Configuration, SQL API, S3 API, authorization, annotations, ZIP and storage.

This section documents the configuration variables, SQL functions, HTTP endpoints, authorization rules, and storage semantics of the pgsilo PostgreSQL backend (schema 14). For installation steps, see Installation. For component responsibilities, see Architecture.

Reference pages

PageCoverage
ConfigurationSILO_PG_* variables, connection pools, concurrent request queueing, TLS, region selection, and persistent store settings
SQL APISignatures, return columns, transaction rules, and SQLSTATE codes for all 11 public silo_api functions (Preview)
S3 APIBucket and object operations, multipart uploads, conditional requests, notifications, service accounts, and STS
AuthorizationDatabase owner vs. SQL application roles vs. S3 IAM, plus iam_and_pg joint authorization (Preview)
AnnotationsNamed UTF-8 text attachments on object versions, custom IAM actions, conditional parent checks, and copy directives (Preview)
ZIP extractionRead-only virtual member access via x-minio-extract: true, snapshot isolation, and archive resource bounds (Preview)
Storage layoutSegment layout, version lifecycles, Object Lock, SSE encryption, hard bucket quotas, and PostgreSQL space reclamation
CompatibilitySupported S3 operations, MVP vs. Preview classification, hard limits, and unsupported MinIO/EC features

1 - Configuration

Environment variables, connection pools, limits and startup options.

Set SILO_PG_DSN to enable the PostgreSQL backend. In PostgreSQL mode, silo server takes no filesystem directory arguments. Alternatively, pass a single postgres:// or postgresql:// URI on the command line. Do not combine both methods or add disk paths. For systemd services, store SILO_PG_DSN in a protected environment file so database passwords do not appear in process arguments.

PostgreSQL backend variables

VariableDefaultRange and semantics
SILO_PG_DSNNoneDirect connection to PostgreSQL 16+ as a trusted ordinary database owner
SILO_PG_READ_ONLYoffon enforces read-only gateway mode; skips initialization, schema migration, and background maintenance
SILO_PG_MAX_CONNS32Total database connection budget per gateway (5–1024)
SILO_PG_CONTROL_CONNS4Control-plane connection pool (1–64)
SILO_PG_COORD_CONNS2Coordination pool (2–64), including the dedicated revision LISTEN connection
SILO_PG_SEGMENT_SIZE8MiBSegment size (1MiB–64MiB), persisted in the database at initial setup
SILO_PG_MAX_OBJECT_SIZE256MiBMaximum object size (1MiB–1GiB), persisted at initial setup; applies to single PUT, copy, and completed multipart objects
SILO_PG_ACQUIRE_TIMEOUT5sConnection pool acquisition deadline (1ms–1m)
SILO_PG_REQUEST_TIMEOUT15mStorage request deadline (1ms–24h)
SILO_PG_QUEUE_TIMEOUT5sMaximum wait for a free concurrent request slot (0s–1m; 0s disables waiting). Added in 1d387725c (2026-11-08)

The data connection pool size equals SILO_PG_MAX_CONNS - SILO_PG_CONTROL_CONNS - SILO_PG_COORD_CONNS. The result must be at least 2 (26 with default settings). All three settings are validated together at startup: for example, SILO_PG_MAX_CONNS=5 is rejected if CONTROL_CONNS (4) and COORD_CONNS (2) remain at their defaults.

Use explicit byte units (MiB, GiB) and Go duration strings (500ms, 5s, 15m). Empty or unset variables use defaults; invalid values fail startup rather than silently falling back.

Concurrent request limit and queueing

Each gateway bounds the number of S3 requests executing concurrently to the smallest of three values:

  • SILO_PG_MAX_CONNS
  • Gateway memory limit divided by two segment buffers: memlimit / (2 * SILO_PG_SEGMENT_SIZE) (where memlimit comes from --memlimit or available system memory)
  • Configured api requests_max, if set

Starting with 1d387725c on feat/pg-backend (2026-11-08), requests above the limit wait in an admission queue for up to SILO_PG_QUEUE_TIMEOUT (5s by default). Queued requests do not hold database connections, and disconnected clients abort waiting immediately. When the queue timeout expires, the gateway returns HTTP 503 SlowDown, which AWS SDK for Go v2 and boto3 retry by default. Setting SILO_PG_QUEUE_TIMEOUT=0s disables queueing and returns HTTP 503 SlowDown immediately.

Note

Builds before 1d387725c, including 299378b and the frozen October 8, 2026 local schema 14 checkpoint (3c7fdc03), do not queue: requests above the limit receive HTTP 429 TooManyRequests immediately, which the AWS SDK for Go v2 and boto3 do not retry by default.

Admission queueing only absorbs short bursts. To sustain higher client concurrency:

  1. Raise SILO_PG_MAX_CONNS above the expected concurrent S3 request count (for example, 72 for 64 concurrent clients, leaving 66 data connections after the 4 control and 2 coordination connections).
  2. Ensure gateway memory accommodates 2 * SILO_PG_SEGMENT_SIZE per active slot (about 1.1 GiB for 72 slots at 8MiB segments).
  3. Raise PostgreSQL max_connections above the sum of SILO_PG_MAX_CONNS across all gateways plus application SQL roles, replication, maintenance, and superuser_reserved_connections.
  4. Restart the gateway.

Persistent vs. runtime parameters

Initial store creation writes SILO_PG_SEGMENT_SIZE and SILO_PG_MAX_OBJECT_SIZE into silo.meta. Every subsequent gateway startup (both read-write and read-only) must match the persisted values or the gateway refuses to start. Never edit silo.meta directly to alter segment or object size on an existing store.

Connection pool sizes and timeouts are per-gateway runtime parameters that take effect on gateway restart. Operation-specific bounds can terminate a request earlier than SILO_PG_REQUEST_TIMEOUT (for example, read-only ZIP extraction enforces a 1-minute ceiling).

An explicitly configured read-only gateway (SILO_PG_READ_ONLY=on) never promotes itself to writable. A writable gateway connected to a PostgreSQL standby in recovery also fails write transactions, but with database read-only errors rather than explicit gateway rejection.

Environment file example

The following template is suitable for a systemd EnvironmentFile (/etc/silo/silo-pg.env). Replace all placeholder values and restrict file permissions to 0600. Do not execute this file with source.

SILO_PG_DSN="postgresql://silo_owner:[email protected]:5432/silo?sslmode=verify-full&sslrootcert=/etc/silo/postgres-ca.crt"
MINIO_ROOT_USER="REPLACE_WITH_ROOT_ACCESS_KEY"
MINIO_ROOT_PASSWORD="REPLACE_WITH_LONG_RANDOM_SECRET"
MINIO_REGION="us-east-1"
SILO_PG_READ_ONLY="off"
SILO_PG_MAX_CONNS="32"
SILO_PG_CONTROL_CONNS="4"
SILO_PG_COORD_CONNS="2"
SILO_PG_SEGMENT_SIZE="8MiB"
SILO_PG_MAX_OBJECT_SIZE="256MiB"
SILO_PG_ACQUIRE_TIMEOUT="5s"
SILO_PG_REQUEST_TIMEOUT="15m"
SILO_PG_QUEUE_TIMEOUT="5s"

URL-encode special characters in the DSN password. sslmode=verify-full validates both the PostgreSQL server certificate chain and hostname. Connections must connect directly to PostgreSQL or through a session-mode proxy that preserves LISTEN/NOTIFY, session state, and transactions; do not use a transaction-pooling proxy.

Start the gateway with:

silo server --address :9000 --console-address :9001 --certs-dir /etc/silo/certs

Place public.crt and private.key inside --certs-dir for S3 HTTPS termination. The PostgreSQL client CA (/etc/silo/postgres-ca.crt) and the S3 server TLS certificate (/etc/silo/certs/public.crt) secure different links. See Installation for systemd unit setup.

Region selection

The gateway determines its effective S3 region from the first non-empty source in this order:

  1. MINIO_REGION
  2. Legacy MINIO_REGION_NAME
  3. MINIO_SITE_REGION, falling back to the database-persisted site region setting when unset or empty
  4. Legacy database-persisted region name

Surrounding whitespace is trimmed from environment values, and a whitespace-only MINIO_SITE_REGION bypasses the persisted site region. Unset unused variables rather than setting them to spaces. If the selected non-empty value is invalid, startup fails immediately without falling back to lower-priority sources. All gateways sharing a database must resolve the same effective region.

Root credentials, encryption, and compatibility names

MINIO_* environment variable names are retained for compatibility with existing S3 tools and service templates. PGSTY and Silo are not affiliated with MinIO, Inc.

  • MINIO_ROOT_USER and MINIO_ROOT_PASSWORD define the S3 root credentials. All gateways attached to the same database must share identical root credentials, effective region, and SSE-S3 keys.
  • Built-in static SSE-S3 (AES256) uses MINIO_KMS_SECRET_KEY (key-name:base64-key) or MINIO_KMS_SECRET_KEY_FILE. Back up the static key before enabling default bucket encryption; losing the key makes encrypted objects permanently unreadable. See Encryption.
  • General Silo flags for erasure-coded disks, S2 object compression, external etcd IAM, SSE-KMS, and remote tiering do not apply to the PostgreSQL backend. See Compatibility.

2 - SQL API

The eleven silo_api functions, their arguments, permissions and limits.
Note

The public silo_api SQL interface is a Preview feature in the MVP release. Callers must connect with an ordinary application SQL role (never the installation owner) and execute write functions under Read Committed isolation.

The public SQL API consists of the 11 functions in the silo_api schema listed below. Functions and tables in the silo schema are private implementation internals and must not be called by applications.

Calling contract

  • Authorization checks session_user; SET ROLE is rejected. The installation owner (silo_owner) and its role members cannot call silo_api functions.
  • Callers need USAGE on silo_api, EXECUTE on each required function, and the corresponding table privileges on the bucket’s ACL relation in silo_bucket. Functions are not granted to PUBLIC. See Authorization.
  • Write functions require Read Committed (or PostgreSQL Read Uncommitted, which behaves identically). Calling write functions under Repeatable Read or Serializable raises SQLSTATE 0A000.
  • Object mutations and application table rows commit or roll back atomically in the same SQL transaction. Independent S3 HTTP requests do not join that transaction. Direct SQL writes do not emit S3 bucket event notifications.
  • Object keys are 1–1024 UTF-8 bytes; zero-length bytea bodies are valid. Passing SQL NULL for p_version_id targets the current version. To target an S3 null version explicitly, pass UUID '00000000-0000-0000-0000-000000000000' (not the string 'null').
  • Inline put_object, get_object, and copy_object bodies are capped at min(SILO_PG_MAX_OBJECT_SIZE, 256 MiB). read_object returns at most 8 MiB (8388608 bytes) per call.
  • SQL functions do not decrypt SSE-encrypted bodies or allow plaintext writes to bypass default bucket encryption. All SQL mutations obey synchronized bucket policies, hard bucket quotas, Object Lock retention, and legal holds, with no governance bypass parameter.

Object functions

put_object

silo_api.put_object(
  p_bucket text, p_key text, p_data bytea,
  p_content_type text DEFAULT 'application/octet-stream',
  p_user_meta jsonb DEFAULT '{}',
  p_if_none_match boolean DEFAULT false,
  p_if_match text DEFAULT NULL
)
RETURNS TABLE (
  object_id bigint, version_id uuid, etag text,
  size bigint, mod_time timestamptz
)

Requires INSERT on the destination bucket ACL relation. Setting p_if_none_match = true succeeds only when no current object body exists (a current delete marker does not block the write). p_if_match takes an unquoted ETag string, or '*' to require an existing current body. The two condition parameters are mutually exclusive and each additionally requires SELECT on the bucket. Conditions are evaluated atomically at publication.

p_user_meta must be a flat JSON object with string values (for example, '{"invoice-id":"1001"}'). Omit the x-amz-meta- prefix; the function normalizes keys and rejects reserved names, case-insensitive duplicates, CR/LF characters, and non-string values. Total normalized user metadata is capped at 2048 bytes, and p_content_type is capped at 1024 bytes without CR/LF.

stat_object

silo_api.stat_object(
  p_bucket text, p_key text, p_version_id uuid DEFAULT NULL
)
RETURNS TABLE (
  object_id bigint, version_id uuid,
  is_latest boolean, is_delete_marker boolean,
  size bigint, actual_size bigint, etag text, content_type text,
  user_meta jsonb, user_tags text, mod_time timestamptz,
  commit_seq bigint, encrypted boolean
)

Requires SELECT on the bucket. Returns metadata (including whether the selected version is a delete marker) without reading the object body or exposing private encryption keys. user_meta contains user metadata stripped of x-amz-meta- prefixes. size is the stored payload size and actual_size is the logical plaintext size.

get_object

silo_api.get_object(
  p_bucket text, p_key text, p_version_id uuid DEFAULT NULL
) RETURNS bytea

Requires SELECT on the bucket. Returns the complete plaintext body within the 256 MiB inline limit. Raises SO001 if the selected version is a delete marker or missing, and 0A000 if the object is encrypted.

read_object

silo_api.read_object(
  p_bucket text, p_key text,
  p_offset bigint DEFAULT 0, p_length bigint DEFAULT 8388608,
  p_version_id uuid DEFAULT NULL, p_object_id bigint DEFAULT NULL
)
RETURNS TABLE (
  object_id bigint, version_id uuid, offset_bytes bigint, data bytea
)

Requires SELECT on the bucket. p_offset must be >= 0 and not past the end of the object; p_length must be 0–8388608 (8 MiB). Reads crossing the end of the object are truncated. When p_object_id is non-NULL, the function verifies that the selected version still has that object_id and raises SO002 on mismatch. To keep multi-chunk reads consistent across statements, pin an immutable version_id or run inside a read-only Repeatable Read transaction.

list_objects

silo_api.list_objects(
  p_bucket text, p_prefix text DEFAULT '',
  p_after_key text DEFAULT NULL, p_limit integer DEFAULT 1000
)
RETURNS TABLE (
  object_id bigint, key text, version_id uuid, size bigint,
  etag text, content_type text, mod_time timestamptz, commit_seq bigint
)

Requires SELECT on the bucket. Lists current visible objects (excluding delete markers) ordered by key COLLATE "C". p_limit accepts 0–1000. Pass the last key of a page as p_after_key to fetch the next page. Historical versions and S3 delimiter rollups are not exposed here.

delete_object

silo_api.delete_object(
  p_bucket text, p_key text,
  p_version_id uuid DEFAULT NULL, p_if_match text DEFAULT NULL
)
RETURNS TABLE (
  deleted boolean, version_id uuid, is_delete_marker boolean
)

Requires DELETE on the bucket (plus SELECT when p_if_match is set). Omitting p_version_id either removes the current object or inserts a delete marker according to the bucket’s versioning state. Specifying p_version_id deletes that version unless blocked by Object Lock retention or legal hold (SL003).

copy_object

silo_api.copy_object(
  p_src_bucket text, p_src_key text,
  p_dst_bucket text, p_dst_key text,
  p_src_version_id uuid DEFAULT NULL,
  p_if_none_match boolean DEFAULT false,
  p_if_match text DEFAULT NULL
)
RETURNS TABLE (
  object_id bigint, version_id uuid, etag text,
  size bigint, mod_time timestamptz
)

Requires SELECT on the source bucket and INSERT on the destination bucket (plus destination SELECT when a destination condition is set). Reads the source body, tags, public metadata, and annotations from a single snapshot and publishes the destination object and annotations atomically. Rejects encrypted source objects or encrypted annotations.

Bucket functions

create_bucket

silo_api.create_bucket(
  p_name text, p_region text DEFAULT 'us-east-1'
)
RETURNS TABLE (
  name text, created_at timestamptz, region text, acl_relation regclass
)

Controlled by EXECUTE privilege on silo_api.create_bucket(text, text). Bucket names must be valid lowercase S3 names (3–63 bytes). Empty region defaults to 'us-east-1'; 'EU' maps to 'eu-west-1'. The creator receives SELECT, INSERT, and DELETE on the new acl_relation in silo_bucket.

bucket_info and list_buckets

silo_api.bucket_info(p_name text)
RETURNS TABLE (
  name text, created_at timestamptz, region text,
  versioning text, acl_relation regclass
)

silo_api.list_buckets()
RETURNS TABLE (
  name text, created_at timestamptz, region text,
  versioning text, acl_relation regclass
)

Filtered by the caller’s bucket privileges: holding at least one of SELECT, INSERT, or DELETE on a bucket’s ACL relation makes that bucket visible. bucket_info raises 42501 if the bucket does not exist or the caller lacks privileges.

drop_bucket

silo_api.drop_bucket(p_name text) RETURNS void

Requires DELETE on the bucket ACL relation and requires the bucket to be completely empty (no current objects, historical versions, or delete markers). There is no force parameter in SQL.

Errors and retries

Classify failures by SQLSTATE code rather than error message text:

SQLSTATEMeaningApplication handling
42501Role, function, or bucket permission deniedFix role bindings and GRANT statements; do not retry
22023Invalid argument, byte range, condition, or metadataFix caller input
0A000Unsupported write isolation level, encrypted payload, or unsynchronized bucket policyUse Read Committed for writes; use S3 API for encrypted objects
SO001Object body or version does not exist (or is a delete marker)Handle missing object
SO002ETag condition or p_object_id mismatchRe-read current state and decide whether to retry
SO003Object exceeds the 256 MiB inline SQL limitUse read_object chunked reads or the S3 API
SO004Incomplete object segment dataAbort and inspect storage consistency
SB001 / SB002 / SB003Bucket missing / bucket not empty / bucket already existsHandle at the application level
SL003Version protected by Object Lock retention or legal holdKeep protected version; SQL has no governance bypass
SL004Bucket or object lock state not yet synchronizedVerify compatible gateway processes are running
SQ001Hard bucket quota exceededFree logical space or increase bucket quota
SA004Annotation payload integrity failureReject corrupt payload and inspect storage

See the SQL Object Operations tutorial for end-to-end transactional examples.

3 - S3 API

Supported S3 operations, headers and extensions.
Note

Core bucket/object CRUD, versioning, multipart uploads, SSE-S3/SSE-C encryption, webhook notifications, IAM users/policies, and service accounts are part of the pgsilo MVP target. Basic AssumeRole STS, bucket lifecycle expiration/abort, Object Lock retention/legal hold, hard bucket quotas, object annotations, and read-only ZIP extraction are Preview features.

This page summarizes the HTTP S3 operations, headers, and extensions supported by the schema 14 PostgreSQL backend. Examples use path-style addressing (/{bucket}/{key}). For hands-on examples, see SDK & CLI Access and Multipart, Lock & Notifications.

Endpoints, signatures, and clients

  • S3 and STS share the gateway API port (9000 by default); the web Console uses 9001 by default. Never pass the Console port as an S3 SDK endpoint.
  • Sign requests with AWS Signature Version 4 (s3 service name for object/bucket calls, sts for AssumeRole) using the gateway’s effective region.
  • Path-style addressing works out of the box. Virtual-hosted-style addressing requires MINIO_DOMAIN, wildcard DNS for bucket subdomains, and TLS certificates covering those hostnames.
  • Presigned GET/PUT URLs and POST policy forms are supported within their signed expiration and conditions.
ClientPrimary useConfiguration notes
mcliBuckets, objects, IAM users/policies, service accounts, quotas, and admin statusSeparate administrative aliases from application credentials
AWS CLI (s3 / s3api / sts)Versioned object calls, multipart uploads, tagging, Object Lock, and AssumeRolePass --endpoint-url, --ca-bundle, and --region
boto3 / AWS SDK for Go v2Application S3 access and automated testsUse path-style addressing; SDKs automatically retry HTTP 503 SlowDown
Custom SigV4 HTTP clientObject annotations and x-minio-extract ZIP headers not modeled by standard SDKsSign full query parameters and extension headers

Bucket and object operations

OperationHTTP formBehavior and limits
ListBucketsGET /Lists buckets visible to the caller identity
CreateBucket / HeadBucket / DeleteBucketPUT / HEAD / DELETE /{bucket}Standard DeleteBucket requires an empty bucket; LocationConstraint must match the effective region
GetBucketLocationGET /{bucket}?locationReturns the effective region
ListObjects / ListObjectsV2GET /{bucket} / GET /{bucket}?list-type=2Supports prefix, delimiter, and continuation tokens
PutObject / GetObject / HeadObjectPUT / GET / HEAD /{bucket}/{key}Supports user metadata, content type, conditionals, byte ranges, checksums, and SSE
CopyObjectPUT /{bucket}/{key} with x-amz-copy-sourceCopies across keys or buckets atomically; supports source version selection
DeleteObject / DeleteObjectsDELETE /{bucket}/{key} / POST /{bucket}?deleteCreates a delete marker in versioned buckets when versionId is omitted; batch delete handles up to 1000 keys
GetObjectAttributesGET /{bucket}/{key}?attributesReturns ETag, checksums, object size, and multipart part metadata
SelectObjectContentPOST /{bucket}/{key}?select&select-type=2S3 Select over CSV, JSON, and Parquet payloads

The default maximum object size is 256 MiB (SILO_PG_MAX_OBJECT_SIZE), configurable up to 1 GiB at initial store setup. Single PUT, CopyObject, and completed multipart objects all enforce this limit.

Sending DELETE /{bucket} with a non-empty x-minio-force-delete header (including the literal string false) requires s3:ForceDeleteBucket in addition to s3:DeleteBucket. Object-lock buckets reject force deletion with HTTP 405 even when empty.

Versioning, conditionals, ranges, and checksums

Use GET/PUT /{bucket}?versioning to inspect or change bucket versioning (Enabled or Suspended) and GET /{bucket}?versions (ListObjectVersions) to list versions and delete markers.

FeatureHeaders or query parametersNotes
Read conditionalsversionId, If-Match, If-None-Match, If-Modified-Since, If-Unmodified-SinceReturns 304 Not Modified or 412 Precondition Failed according to HTTP method
Write / Copy destination conditionalsIf-Match, If-None-MatchChecked atomically at publication without a separate HEAD race
Conditional deleteIf-Match, optional versionIdVerifies target ETag before deleting or adding a delete marker
Copy source conditionalsx-amz-copy-source-if-*Checked against the selected source version
Byte range readsRange: bytes=start-endSingle byte range supported; cannot be combined with partNumber
Part readspartNumber=NReads a specific part of a completed multipart object

Supported checksum algorithms include CRC32, CRC32C, CRC64NVME, SHA1, SHA256, MD5, SHA512, XXHASH64, XXHASH3, and XXHASH128. Note that ETag values for multipart or encrypted objects are not plain MD5 digests.

Multipart uploads

StageHTTP formS3 operation
InitiatePOST /{bucket}/{key}?uploadsCreateMultipartUpload
Upload partPUT /{bucket}/{key}?partNumber=N&uploadId=IDUploadPart
Copy partPUT /{bucket}/{key}?partNumber=N&uploadId=ID + x-amz-copy-sourceUploadPartCopy
List partsGET /{bucket}/{key}?uploadId=IDListParts
List active uploadsGET /{bucket}?uploadsListMultipartUploads
CompletePOST /{bucket}/{key}?uploadId=IDCompleteMultipartUpload
AbortDELETE /{bucket}/{key}?uploadId=IDAbortMultipartUpload

Part numbers run from 1 to 10000, and every part except the last must be at least 5 MiB. Unfinished parts consume physical database storage but do not count toward logical bucket quota until CompleteMultipartUpload publishes the assembled object in a single transaction. Abort failed uploads explicitly or configure an AbortIncompleteMultipartUpload lifecycle rule.

Subresources: tags, lock, encryption, lifecycle, CORS, notifications

SubresourceMethodsScope and status
Object ?taggingGET / PUT / DELETEUp to 10 key-value tags per object version (MVP)
Bucket ?taggingGET / PUT / DELETEBucket-level tag set (MVP)
Bucket ?policyGET / PUT / DELETEBucket policies persisted in PostgreSQL; combined with native role grants under iam_and_pg (MVP)
Bucket ?encryptionGET / PUT / DELETEDefault AES256 encryption using built-in static KMS; external SSE-KMS is unsupported (MVP)
Bucket ?corsGET / PUT / DELETE, OPTIONSPer-bucket CORS rules; does not bypass SigV4 or IAM checks (MVP)
Bucket ?notificationGET / PUTPublishes S3 object events to configured webhook targets (MVP)
Bucket ?object-lockGET / PUT (enabled at bucket creation)Default GOVERNANCE or COMPLIANCE retention on versioned buckets (Preview)
Object ?retention, ?legal-holdGET / PUTPer-version retention and legal hold; governance bypass requires x-amz-bypass-governance-retention: true and s3:BypassGovernanceRetention (Preview)
Bucket ?lifecycleGET / PUT / DELETECurrent/noncurrent expiration, expired delete-marker cleanup, and incomplete multipart abort; no remote tiering (Preview)

Webhook notifications

  1. Configure a webhook target on the gateway via MINIO_NOTIFY_WEBHOOK_ENABLE_<ID>=on and MINIO_NOTIFY_WEBHOOK_ENDPOINT_<ID>=https://....
  2. Attach bucket notification rules referencing arn:minio:sqs:<region>:<ID>:webhook using PutBucketNotificationConfiguration or mcli event add.

S3 HTTP mutations and background lifecycle expirations emit bucket notifications after transaction commit (at-least-once delivery; consumers must handle duplicates). Direct SQL mutations via silo_api never emit S3 bucket notifications.

IAM service accounts and STS

IAM users, groups, policies, service accounts, and STS metadata are stored in PostgreSQL and managed through mcli admin user, mcli admin policy, and mcli admin user svcacct.

  • Service accounts belong to a parent IAM user, optionally carry a session policy (up to 2048 serialized bytes) that narrows the parent’s permissions, and support an optional expiration between 15 minutes and 365 days from issuance.
  • Basic AssumeRole STS (Preview) accepts a form POST / signed with an ordinary IAM user’s SigV4 credentials (Action=AssumeRole&Version=2011-06-15). DurationSeconds defaults to 3600 (1 hour) and accepts 900–31536000 seconds (15 minutes to 365 days) unless overridden by MINIO_STS_DURATION.
  • Service accounts and STS temporary credentials cannot call AssumeRole recursively to extend credential chains.
  • Direct exchange of PostgreSQL database usernames/passwords for STS credentials is not implemented, and external OIDC/LDAP STS flows (AssumeRoleWithWebIdentity, AssumeRoleWithLDAPIdentity) are not part of the validated pgsilo scope.

Unsupported S3 APIs

The PostgreSQL backend does not implement bucket or site replication, remote storage tiering, RestoreObject, object-level canned ACLs, S3 Inventory, static website hosting, server access logging, Transfer Acceleration, RequestPayment, BitTorrent, or external SSE-KMS. See Compatibility for the complete matrix.

4 - Authorization

IAM policies and native PostgreSQL authorization, and how the two combine.
Note

S3 IAM users, policies, and service accounts are part of the core pgsilo MVP. SQL application role grants (silo_api / silo_bucket) and joint S3-to-PostgreSQL authorization (iam_and_pg mode) are Preview features in the MVP release.

pgsilo separates three kinds of identities:

  1. Database owner (silo_owner): the trusted ordinary PostgreSQL role used by silo server gateways via SILO_PG_DSN.
  2. SQL application logins (e.g., app_sql): independent unprivileged PostgreSQL roles that call silo_api functions.
  3. S3 identities: S3 root credentials, IAM users, service accounts, and STS temporary sessions.

Never connect applications or S3 bindings as the installation owner (silo_owner) or a PostgreSQL superuser.

SQL application privileges

Create an unprivileged login role for SQL callers:

CREATE ROLE app_sql LOGIN NOSUPERUSER NOCREATEDB NOCREATEROLE
  NOREPLICATION NOBYPASSRLS;
\password app_sql

As the installation owner (silo_owner), grant schema USAGE, function EXECUTE, and table privileges on the target bucket’s ACL relation in silo_bucket:

GRANT USAGE ON SCHEMA silo_api, silo_bucket TO app_sql;
GRANT EXECUTE ON FUNCTION
  silo_api.put_object(text,text,bytea,text,jsonb,boolean,text),
  silo_api.get_object(text,text,uuid),
  silo_api.stat_object(text,text,uuid),
  silo_api.read_object(text,text,bigint,bigint,uuid,bigint),
  silo_api.list_objects(text,text,text,integer)
TO app_sql;

SELECT format('GRANT SELECT, INSERT ON TABLE %I.%I TO %I',
              n.nspname, c.relname, 'app_sql')
FROM silo.bucket_acl a
JOIN silo.buckets b ON b.id = a.bucket_id
JOIN pg_catalog.pg_class c ON c.oid = a.relation_oid
JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace
WHERE b.name = 'attachments' AND n.nspname = 'silo_bucket'
\gexec
SQL operationRequired bucket ACL privilege
stat_object, get_object, read_object, list_objectsSELECT
put_object (including unconditional overwrite)INSERT
Conditional put_object, copy_object, delete_objectOperation privileges plus SELECT
copy_objectSource SELECT and destination INSERT
delete_object, drop_bucketDELETE (drop_bucket also requires an empty bucket)
bucket_info, list_bucketsAt least one of SELECT, INSERT, or DELETE
create_bucketEXECUTE on silo_api.create_bucket(text, text)

Callers must connect directly as app_sql (session_user is checked; SET ROLE is rejected). Recreating a dropped bucket generates a new ACL relation in silo_bucket and requires fresh GRANT statements.

Joint authorization (iam_and_pg)

By default (iam mode), S3 requests are authorized solely by S3 IAM and bucket policies. Optional iam_and_pg mode requires both S3 IAM evaluation and the bound PostgreSQL role’s silo_bucket privileges to succeed:

  • An explicit IAM Deny, service-account policy restriction, or STS session policy restriction always denies the request; PostgreSQL GRANT statements never override an IAM denial.
  • The authorization mode is stored in the shared database (silo.set_native_auth_mode) and applies across all gateways connected to that database.
  • Anonymous S3 requests have no PostgreSQL role binding and are rejected in iam_and_pg mode.

Bound PostgreSQL roles must be independent ordinary roles (NOLOGIN roles are recommended for S3-only principals) and must not:

  • Hold SUPERUSER, CREATEDB, CREATEROLE, REPLICATION, or BYPASSRLS
  • Inherit the installation owner (silo_owner), schema owners, pg_read_all_data, or pg_write_all_data
  • Hold privileges on the private silo schema
  • Hold WITH GRANT OPTION on silo_api functions or CREATE on silo_api / silo_bucket

Enabling iam_and_pg mode

After creating the IAM user app-s3 and granting bucket privileges to app_sql, create a dedicated NOLOGIN role for the S3 root identity and bind both principals inside a transaction as silo_owner:

CREATE ROLE silo_native_root NOLOGIN NOSUPERUSER NOCREATEDB NOCREATEROLE
  NOREPLICATION NOBYPASSRLS;
BEGIN;
GRANT USAGE ON SCHEMA silo_bucket TO silo_native_root;

SELECT format('GRANT SELECT, INSERT, UPDATE, DELETE ON TABLE %I.%I TO %I',
              n.nspname, c.relname, 'silo_native_root')
FROM silo.bucket_acl a
JOIN silo.buckets b ON b.id = a.bucket_id
JOIN pg_catalog.pg_class c ON c.oid = a.relation_oid
JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace
WHERE b.name = 'attachments' AND n.nspname = 'silo_bucket'
\gexec

SELECT silo.bind_native_root('silo_native_root'::regrole);
SELECT silo.bind_native_principal('iam:app-s3', 'app_sql'::regrole);
SELECT silo.set_native_auth_mode('iam_and_pg');
COMMIT;

Before switching an active deployment to iam_and_pg, bind every required root and IAM user identity and grant privileges on all target buckets.

S3-to-PostgreSQL privilege mapping

S3 operation classRequired PostgreSQL privilege in iam_and_pg mode
Object GET/HEAD, version reads, listings, tag/retention/bucket-config readsSELECT on bucket ACL relation
Object PUT, tag writes, retention/legal-hold writes, annotation PUTINSERT on bucket ACL relation
Object/version DELETE, AbortMultipartUpload, annotation DELETEDELETE on bucket ACL relation
Bucket configuration changes, governance-retention bypassUPDATE on bucket ACL relation (plus operation-specific privileges)
DeleteBucket, ForceDeleteBucketDELETE and UPDATE on bucket ACL relation
CreateBucketEXECUTE on silo_api.create_bucket(text, text)
Conditional writes/deletes and annotation mutations with x-amz-object-if-matchOperation privilege plus SELECT on bucket ACL relation
CopyObjectSource SELECT and destination INSERT (plus annotation IAM actions when copying annotations)

Service accounts and STS temporary credentials inherit the PostgreSQL role binding of their parent IAM user while enforcing their own IAM and session-policy restrictions.

Revoking bindings and restoring default mode

As silo_owner, unbind principals or switch back to iam mode:

SELECT silo.unbind_native_principal('iam:app-s3');
-- To unbind the root identity:
-- SELECT silo.unbind_native_principal('root:');

-- To restore IAM-only S3 authorization:
SELECT silo.set_native_auth_mode('iam');

Bindings track both the PostgreSQL role OID and the IAM user generation. Dropping and recreating a role or IAM user with the same name requires re-running silo.bind_native_principal. Switching S3 back to iam mode does not relax privileges on the silo_api SQL functions.

5 - Annotations

The annotation API and its policy actions.
Note

The object annotation protocol is a Preview extension in the MVP release. Policy evaluation for the four s3:*ObjectAnnotation actions depends on the unpublished silo-pkg revision (27697e8) compiled into the pgsilo branch.

An object annotation is a named UTF-8 text payload attached to a specific parent object version—such as OCR text, classification labels, or review notes. Introduced in schema 13 and retained in schema 14, annotations are stored separately from S3 user metadata (x-amz-meta-*) and object tags. Updating an annotation neither rewrites the parent object body nor creates a new parent version.

HTTP requests and permissions

Target the parent object key and sign the full path, query string, and headers with AWS SigV4:

OperationHTTP requestRequired IAM actionAdditional bucket privilege (iam_and_pg)
Write or replacePUT /{bucket}/{key}?annotation=&annotationName=labels.jsons3:PutObjectAnnotationINSERT
Read payloadGET /{bucket}/{key}?annotation=&annotationName=labels.jsons3:GetObjectAnnotationSELECT
List namesGET /{bucket}/{key}?annotation=s3:ListObjectAnnotationsSELECT
DeleteDELETE /{bucket}/{key}?annotation=&annotationName=labels.jsons3:DeleteObjectAnnotationDELETE
  • Standard s3:GetObject and s3:PutObject permissions do not grant annotation access. IAM policy resources reference the parent object ARN (arn:aws:s3:::bucket/key or prefix).
  • The annotation query parameter must appear once with an empty value. PUT and DELETE require a non-empty annotationName. GET without annotationName lists all annotations on the selected parent version; GET with annotationName returns that annotation’s body. There is no annotation HEAD endpoint.
  • Successful PUT returns HTTP 200, DELETE returns HTTP 204, and GET returns Content-Type: text/plain; charset=utf-8 along with the annotation’s own ETag, Last-Modified, and parent x-amz-version-id.

Size and naming bounds

PropertyLimit
Annotations per parent object version1000
Plaintext payload size1 byte – 1 MiB
Annotation name (annotationName)1 – 512 UTF-8 bytes (no XML-invalid control characters)
Payload encodingValid UTF-8

Annotation names are treated as flat identifiers rather than filesystem paths. Annotation bytes count toward the bucket’s hard logical quota.

A list request (GET /{bucket}/{key}?annotation=) returns up to 1000 entries in a single response without pagination parameters:

<ListObjectAnnotationsOutput>
  <Annotation>
    <AnnotationName>labels.json</AnnotationName>
    <Size>18</Size>
    <ETag>"ANNOTATION_ETAG"</ETag>
    <LastModified>2026-10-08T00:00:00Z</LastModified>
  </Annotation>
</ListObjectAnnotationsOutput>

Parent version selection and conditional writes

Pass versionId to target a specific historical parent version; omitting versionId targets the current visible object (excluding delete markers).

PUT and DELETE accept x-amz-object-if-match: "<PARENT_ETAG>" to verify the parent object’s ETag atomically (requires SELECT under iam_and_pg mode). Note that x-amz-object-if-match checks the parent object body’s ETag, not the previous annotation’s ETag.

PUT /attachments/invoices/1001.txt?annotation=&annotationName=labels.json HTTP/1.1
Host: s3.example.net
x-amz-object-if-match: "PARENT_OBJECT_ETAG"
Content-Type: text/plain; charset=utf-8
Authorization: AWS4-HMAC-SHA256 ...

{"reviewed":true}

For runnable Python signing examples, see Annotations & ZIP Extraction.

Lifecycle, copying, and encryption

  • Independent mutability: annotations have no version history of their own. Updating an annotation leaves the parent object’s body, ETag, modification time, tags, Object Lock retention, and legal hold untouched. Parent Object Lock does not make annotations immutable.
  • Unlinking and cleanup: overwriting an unversioned object discards its previous annotation set; deleting a specific parent version unlinks only that version’s annotations. Unlinking releases logical bucket quota immediately, while a writable gateway’s background maintenance worker deletes the unlinked physical rows in batches.
  • Copy directives: S3 CopyObject accepts x-amz-annotation-directive: COPY (default) or EXCLUDE. Copying a non-empty annotation set requires s3:GetObjectAnnotation on the source and s3:PutObjectAnnotation on the destination. SQL silo_api.copy_object always copies plaintext annotations atomically and has no EXCLUDE option.
  • Encryption: annotations inherit the parent version’s SSE-C or static SSE-S3 protection and require the matching key on PUT and GET. Public SQL functions have no annotation CRUD endpoints and reject copying objects with encrypted annotations.

Error responses

Error or statusMeaning
InvalidArgument (HTTP 400)Malformed query parameters, invalid UTF-8 name/body, or unsupported headers
TooManyAnnotations (HTTP 400)Parent version already has 1000 annotations
NoSuchAnnotation (HTTP 404)Requested annotationName does not exist on the selected parent version
AccessDenied (HTTP 403)Missing s3:*ObjectAnnotation action, parent policy denial, or missing native bucket privilege
PreconditionFailed (HTTP 412)x-amz-object-if-match does not match the parent version’s ETag

6 - ZIP extraction

Extracting ZIP archives with x-minio-extract, and its limits.
Note

Read-only ZIP member extraction (x-minio-extract: true) is a Preview extension in the MVP release.

Introduced in schema 13 and retained in schema 14, the PostgreSQL backend can expose members inside a stored .zip object as read-only virtual objects over S3. The gateway never extracts files onto local disk, creates separate object rows, or persists a ZIP index in PostgreSQL.

Request forms

Include x-minio-extract: true on a GET or HEAD request whose key path traverses inside a .zip archive:

GET /attachments/archive.zip/docs/readme.txt HTTP/1.1
Host: s3.example.net
x-minio-extract: true
Authorization: AWS4-HMAC-SHA256 ...

To list archive members, send a ListObjectsV2 request (list-type=2) with x-minio-extract: true and a prefix containing .zip/:

GET /attachments?list-type=2&prefix=archive.zip%2F HTTP/1.1
Host: s3.example.net
x-minio-extract: true
Authorization: AWS4-HMAC-SHA256 ...

The first .zip/ boundary in the key identifies the parent archive object. In a.zip/b.zip/c.txt, the parent archive is a.zip and the requested member path is b.zip/c.txt; nested archives are not recursively opened. Without x-minio-extract: true, requests treat the full key as an ordinary S3 object name. For runnable SDK code, see Annotations & ZIP Extraction.

Authorization and snapshot isolation

  • Reading a member requires s3:GetObject on the parent .zip object (or s3:GetObjectVersion when versionId is specified). Listing members additionally requires s3:ListBucket. Under iam_and_pg joint authorization, only SELECT on the bucket ACL relation is required.
  • Central directory parsing, member decompression, parent version metadata, and SSE decryption all read from a single pinned PostgreSQL snapshot. Concurrent S3 or SQL overwrites, version deletions, or bucket recreations cannot swap the underlying archive segments mid-read.
  • SSE-C and static SSE-S3 encrypted .zip archives are supported through the standard parent decryption path, and read-only standby gateways (SILO_PG_READ_ONLY=on) can serve ZIP extraction requests.

Archive format and resource limits

ParameterLimit
Compression methodsStore (0) and Deflate (8)
ZIP64 descriptorsSupported within the size bounds below
Central directory size<= 16 MiB
Central directory entries<= 10000 entries
Single uncompressed member size<= 256 MiB
Total declared uncompressed archive size<= 1 GiB
Per-request execution timeout<= 1 minute (or shorter outer request timeout)
Member Range or partNumber readsUnsupported (rejected)
Password-protected / encrypted ZIP or multi-disk archivesUnsupported (rejected)

The gateway rejects archives with trailing or corrupt central directory records, out-of-range offsets, duplicate member names, absolute paths, .. path traversal segments, or special file types.

GET vs. HEAD execution cost

Before streaming a GET response body, the gateway validates the target member’s uncompressed size and CRC-32 across the member stream, then streams the decompressed payload from the same database snapshot. Consequently, every member GET performs two decompression passes. HEAD returns member metadata (Content-Length set to uncompressed size, Content-Type inferred from file extension) from the central directory without decompressing the member body.

Each extraction request holds its database connection and snapshot until the stream finishes or times out. For workloads that repeatedly read individual members at high concurrency, unpack and store those files as independent S3 objects instead.

7 - Storage layout

Tables, segments, versions and how space is reclaimed.
Note

Object versioning, multipart uploads, and SSE-S3/SSE-C encryption are part of the core pgsilo MVP. Object Lock retention/legal hold, bucket lifecycle rules, hard bucket quotas, and object annotations are Preview features in the MVP release.

pgsilo stores all bucket metadata, object versions, byte segments, multipart parts, annotations, and IAM state in PostgreSQL (schema 14). Understanding the boundary between object visibility, logical quota accounting, and PostgreSQL physical space reclamation is essential for capacity planning.

Segment layout and multipart publication

Object payloads are split into fixed-size bytea segments stored in silo.object_segments. The default segment size (SILO_PG_SEGMENT_SIZE) is 8 MiB, configurable from 1 MiB to 64 MiB at initial database setup. Streaming S3 reads and range requests fetch only the required segments without buffering the entire object in gateway memory.

The default maximum object size (SILO_PG_MAX_OBJECT_SIZE) is 256 MiB, configurable from 1 MiB to 1 GiB at initialization. Completed multipart uploads obey the same ceiling.

Unfinished multipart parts consume physical table space in PostgreSQL, but they do not count toward a bucket’s committed logical quota until CompleteMultipartUpload atomically validates part order, checksums, quota, and Object Lock rules and publishes the assembled version. Clean up abandoned uploads with AbortMultipartUpload or an AbortIncompleteMultipartUpload lifecycle rule.

Versions and delete markers

Bucket versioning state / operationStorage behavior
Unversioned PUT overwriteReplaces the current unversioned body and unlinks its previous annotation set
Versioned PUT overwritePublishes a new version_id and retains historical versions
Versioned DELETE without versionIdInserts a delete marker as the latest version; historical bodies remain stored and count toward quota
DELETE with explicit versionIdPermanently removes that version (unless blocked by Object Lock retention or legal hold)
Suspended versioning (Suspended)New writes use null-version semantics while preserving existing historical versions
Current version is a delete markerStandard GET / HEAD without versionId returns 404 NoSuchKey

Each published version carries an external version_id (UUID) and an internal object_id (bigint). Independent S3 HTTP requests never share a database snapshot, whereas SQL queries via silo_api can read object bodies and application tables within a single transaction snapshot.

Object Lock and retention (Preview)

Shared database mutation logic enforces GOVERNANCE retention, COMPLIANCE retention, and legal hold across both S3 HTTP requests and silo_api SQL calls. Object-lock buckets require versioning to be enabled at bucket creation.

  • Bypassing GOVERNANCE retention requires an S3 request with x-amz-bypass-governance-retention: true and s3:BypassGovernanceRetention permission (plus UPDATE on the bucket ACL relation under iam_and_pg).
  • Neither COMPLIANCE retention nor an active legal hold can be bypassed through S3 or SQL.
  • silo_api SQL functions inherit default bucket retention on put_object / copy_object and enforce lock checks on delete_object, but expose no governance bypass parameter.
  • Object Lock protects against untrusted S3 and SQL callers; it cannot prevent a PostgreSQL superuser or the trusted database owner (silo_owner) from modifying underlying database tables directly.

Server-side encryption

PathBehavior
SSE-CClient supplies the encryption key over HTTPS on every read, write, copy, or part upload
SSE-S3 (AES256)Uses the gateway’s static KMS key (MINIO_KMS_SECRET_KEY / MINIO_KMS_SECRET_KEY_FILE) for explicit header requests and default bucket encryption
SSE-KMS (external KMS)Not implemented in the PostgreSQL backend
Public SQL API (silo_api)Rejects reading encrypted bodies and rejects plaintext writes to default-encrypted buckets (SQLSTATE 0A000)
Annotations and ZIP extractionInherit the parent object version’s SSE-C or SSE-S3 encryption

SSE encrypts object segment payloads and annotation bodies; it does not encrypt bucket names, object keys, or PostgreSQL catalog metadata. Back up your static MINIO_KMS_SECRET_KEY alongside database backups—restoring PostgreSQL tables without the static KMS key leaves SSE-S3 payloads permanently unreadable.

Hard bucket quotas (Preview)

Hard bucket quotas are enforced atomically in PostgreSQL (silo.bucket_quota) rather than through asynchronous gateway estimates. Billable logical usage (billableBytes) equals the sum of committed object version bodies across all retained versions plus their linked annotation payloads.

OperationEffect on logical bucket quota
Overwrite in a versioned bucketBoth the new version and retained old versions count toward quota
DELETE without versionId in a versioned bucketAdds a zero-byte delete marker; retained historical versions still count
DELETE with versionIdImmediately decrements that version’s body bytes and linked annotation bytes
Replace or delete an annotationImmediately applies the net byte difference
CompleteMultipartUploadChecks total assembled object size against remaining quota at commit

For example, four retained 256 MiB versions consume a full 1 GiB bucket quota even when only one key is visible in ListObjectsV2. Physical overhead from incomplete multipart uploads, PostgreSQL indexes, WAL segments, and dead MVCC tuples is not bounded by logical bucket quota.

Configure and inspect quotas with mcli:

mcli quota set pg/attachments --size 1GiB
mcli quota info pg/attachments

Lifecycle rules, background cleanup, and VACUUM

  • Lifecycle worker (Preview): writable gateways coordinate through PostgreSQL leases (silo.TryLifecycleLock) to expire current/noncurrent versions, remove expired delete markers, and abort incomplete multipart uploads. Remote storage tiering is not supported.
  • Annotation orphan reaper: unlinking annotations (via unversioned overwrite, version deletion, or force bucket deletion) releases logical quota immediately and enqueues orphan payload rows for bounded batch deletion by a writable gateway. Always keep at least one writable silo server gateway connected to the PostgreSQL primary—even if applications only use silo_api over SQL—so background cleanup and native-auth heartbeats continue running.
  • PostgreSQL physical space reclamation: deleting objects or draining the annotation cleanup queue marks PostgreSQL tuples as dead for autovacuum reuse; it does not immediately shrink OS filesystem files. Long-running SQL transactions hold back VACUUM horizon and delay space reuse. Monitor logical bucket usage, annotation cleanup backlog, dead tuple ratios, physical database size, and WAL retention separately.

Force bucket deletion

Standard DeleteBucket (DELETE /{bucket}) requires an empty bucket. Sending x-minio-force-delete: true (any non-empty header value, including "false", triggers the permission check) requires both s3:DeleteBucket and s3:ForceDeleteBucket (plus DELETE and UPDATE under iam_and_pg) and removes all versions, delete markers, and incomplete uploads in a single transaction. Object-lock buckets reject force deletion with HTTP 405 even when empty. SQL silo_api.drop_bucket has no force option.