This is the multi-page printable view of this section.
Reference
- 1: Configuration
- 2: SQL API
- 3: S3 API
- 4: Authorization
- 5: Annotations
- 6: ZIP extraction
- 7: Storage layout
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
| Page | Coverage |
|---|---|
| Configuration | SILO_PG_* variables, connection pools, concurrent request queueing, TLS, region selection, and persistent store settings |
| SQL API | Signatures, return columns, transaction rules, and SQLSTATE codes for all 11 public silo_api functions (Preview) |
| S3 API | Bucket and object operations, multipart uploads, conditional requests, notifications, service accounts, and STS |
| Authorization | Database owner vs. SQL application roles vs. S3 IAM, plus iam_and_pg joint authorization (Preview) |
| Annotations | Named UTF-8 text attachments on object versions, custom IAM actions, conditional parent checks, and copy directives (Preview) |
| ZIP extraction | Read-only virtual member access via x-minio-extract: true, snapshot isolation, and archive resource bounds (Preview) |
| Storage layout | Segment layout, version lifecycles, Object Lock, SSE encryption, hard bucket quotas, and PostgreSQL space reclamation |
| Compatibility | Supported S3 operations, MVP vs. Preview classification, hard limits, and unsupported MinIO/EC features |
1 - Configuration
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
| Variable | Default | Range and semantics |
|---|---|---|
SILO_PG_DSN | None | Direct connection to PostgreSQL 16+ as a trusted ordinary database owner |
SILO_PG_READ_ONLY | off | on enforces read-only gateway mode; skips initialization, schema migration, and background maintenance |
SILO_PG_MAX_CONNS | 32 | Total database connection budget per gateway (5–1024) |
SILO_PG_CONTROL_CONNS | 4 | Control-plane connection pool (1–64) |
SILO_PG_COORD_CONNS | 2 | Coordination pool (2–64), including the dedicated revision LISTEN connection |
SILO_PG_SEGMENT_SIZE | 8MiB | Segment size (1MiB–64MiB), persisted in the database at initial setup |
SILO_PG_MAX_OBJECT_SIZE | 256MiB | Maximum object size (1MiB–1GiB), persisted at initial setup; applies to single PUT, copy, and completed multipart objects |
SILO_PG_ACQUIRE_TIMEOUT | 5s | Connection pool acquisition deadline (1ms–1m) |
SILO_PG_REQUEST_TIMEOUT | 15m | Storage request deadline (1ms–24h) |
SILO_PG_QUEUE_TIMEOUT | 5s | Maximum 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)(wherememlimitcomes from--memlimitor 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.
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:
- Raise
SILO_PG_MAX_CONNSabove the expected concurrent S3 request count (for example,72for 64 concurrent clients, leaving 66 data connections after the 4 control and 2 coordination connections). - Ensure gateway memory accommodates
2 * SILO_PG_SEGMENT_SIZEper active slot (about 1.1 GiB for 72 slots at8MiBsegments). - Raise PostgreSQL
max_connectionsabove the sum ofSILO_PG_MAX_CONNSacross all gateways plus application SQL roles, replication, maintenance, andsuperuser_reserved_connections. - 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.
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:
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:
MINIO_REGION- Legacy
MINIO_REGION_NAME MINIO_SITE_REGION, falling back to the database-persistedsite regionsetting when unset or empty- 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_USERandMINIO_ROOT_PASSWORDdefine 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) usesMINIO_KMS_SECRET_KEY(key-name:base64-key) orMINIO_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 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 ROLEis rejected. The installation owner (silo_owner) and its role members cannot callsilo_apifunctions. - Callers need
USAGEonsilo_api,EXECUTEon each required function, and the corresponding table privileges on the bucket’s ACL relation insilo_bucket. Functions are not granted toPUBLIC. See Authorization. - Write functions require
Read Committed(or PostgreSQLRead Uncommitted, which behaves identically). Calling write functions underRepeatable ReadorSerializableraisesSQLSTATE 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
byteabodies are valid. Passing SQLNULLforp_version_idtargets the current version. To target an S3nullversion explicitly, pass UUID'00000000-0000-0000-0000-000000000000'(not the string'null'). - Inline
put_object,get_object, andcopy_objectbodies are capped atmin(SILO_PG_MAX_OBJECT_SIZE, 256 MiB).read_objectreturns at most8 MiB(8388608bytes) 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
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
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
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
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
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
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
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
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
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
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:
| SQLSTATE | Meaning | Application handling |
|---|---|---|
42501 | Role, function, or bucket permission denied | Fix role bindings and GRANT statements; do not retry |
22023 | Invalid argument, byte range, condition, or metadata | Fix caller input |
0A000 | Unsupported write isolation level, encrypted payload, or unsynchronized bucket policy | Use Read Committed for writes; use S3 API for encrypted objects |
SO001 | Object body or version does not exist (or is a delete marker) | Handle missing object |
SO002 | ETag condition or p_object_id mismatch | Re-read current state and decide whether to retry |
SO003 | Object exceeds the 256 MiB inline SQL limit | Use read_object chunked reads or the S3 API |
SO004 | Incomplete object segment data | Abort and inspect storage consistency |
SB001 / SB002 / SB003 | Bucket missing / bucket not empty / bucket already exists | Handle at the application level |
SL003 | Version protected by Object Lock retention or legal hold | Keep protected version; SQL has no governance bypass |
SL004 | Bucket or object lock state not yet synchronized | Verify compatible gateway processes are running |
SQ001 | Hard bucket quota exceeded | Free logical space or increase bucket quota |
SA004 | Annotation payload integrity failure | Reject corrupt payload and inspect storage |
See the SQL Object Operations tutorial for end-to-end transactional examples.
3 - S3 API
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 (
9000by default); the web Console uses9001by default. Never pass the Console port as an S3 SDK endpoint. - Sign requests with AWS Signature Version 4 (
s3service name for object/bucket calls,stsforAssumeRole) 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.
| Client | Primary use | Configuration notes |
|---|---|---|
mcli | Buckets, objects, IAM users/policies, service accounts, quotas, and admin status | Separate administrative aliases from application credentials |
AWS CLI (s3 / s3api / sts) | Versioned object calls, multipart uploads, tagging, Object Lock, and AssumeRole | Pass --endpoint-url, --ca-bundle, and --region |
boto3 / AWS SDK for Go v2 | Application S3 access and automated tests | Use path-style addressing; SDKs automatically retry HTTP 503 SlowDown |
| Custom SigV4 HTTP client | Object annotations and x-minio-extract ZIP headers not modeled by standard SDKs | Sign full query parameters and extension headers |
Bucket and object operations
| Operation | HTTP form | Behavior and limits |
|---|---|---|
ListBuckets | GET / | Lists buckets visible to the caller identity |
CreateBucket / HeadBucket / DeleteBucket | PUT / HEAD / DELETE /{bucket} | Standard DeleteBucket requires an empty bucket; LocationConstraint must match the effective region |
GetBucketLocation | GET /{bucket}?location | Returns the effective region |
ListObjects / ListObjectsV2 | GET /{bucket} / GET /{bucket}?list-type=2 | Supports prefix, delimiter, and continuation tokens |
PutObject / GetObject / HeadObject | PUT / GET / HEAD /{bucket}/{key} | Supports user metadata, content type, conditionals, byte ranges, checksums, and SSE |
CopyObject | PUT /{bucket}/{key} with x-amz-copy-source | Copies across keys or buckets atomically; supports source version selection |
DeleteObject / DeleteObjects | DELETE /{bucket}/{key} / POST /{bucket}?delete | Creates a delete marker in versioned buckets when versionId is omitted; batch delete handles up to 1000 keys |
GetObjectAttributes | GET /{bucket}/{key}?attributes | Returns ETag, checksums, object size, and multipart part metadata |
SelectObjectContent | POST /{bucket}/{key}?select&select-type=2 | S3 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.
| Feature | Headers or query parameters | Notes |
|---|---|---|
| Read conditionals | versionId, If-Match, If-None-Match, If-Modified-Since, If-Unmodified-Since | Returns 304 Not Modified or 412 Precondition Failed according to HTTP method |
| Write / Copy destination conditionals | If-Match, If-None-Match | Checked atomically at publication without a separate HEAD race |
| Conditional delete | If-Match, optional versionId | Verifies target ETag before deleting or adding a delete marker |
| Copy source conditionals | x-amz-copy-source-if-* | Checked against the selected source version |
| Byte range reads | Range: bytes=start-end | Single byte range supported; cannot be combined with partNumber |
| Part reads | partNumber=N | Reads 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
| Stage | HTTP form | S3 operation |
|---|---|---|
| Initiate | POST /{bucket}/{key}?uploads | CreateMultipartUpload |
| Upload part | PUT /{bucket}/{key}?partNumber=N&uploadId=ID | UploadPart |
| Copy part | PUT /{bucket}/{key}?partNumber=N&uploadId=ID + x-amz-copy-source | UploadPartCopy |
| List parts | GET /{bucket}/{key}?uploadId=ID | ListParts |
| List active uploads | GET /{bucket}?uploads | ListMultipartUploads |
| Complete | POST /{bucket}/{key}?uploadId=ID | CompleteMultipartUpload |
| Abort | DELETE /{bucket}/{key}?uploadId=ID | AbortMultipartUpload |
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
| Subresource | Methods | Scope and status |
|---|---|---|
Object ?tagging | GET / PUT / DELETE | Up to 10 key-value tags per object version (MVP) |
Bucket ?tagging | GET / PUT / DELETE | Bucket-level tag set (MVP) |
Bucket ?policy | GET / PUT / DELETE | Bucket policies persisted in PostgreSQL; combined with native role grants under iam_and_pg (MVP) |
Bucket ?encryption | GET / PUT / DELETE | Default AES256 encryption using built-in static KMS; external SSE-KMS is unsupported (MVP) |
Bucket ?cors | GET / PUT / DELETE, OPTIONS | Per-bucket CORS rules; does not bypass SigV4 or IAM checks (MVP) |
Bucket ?notification | GET / PUT | Publishes S3 object events to configured webhook targets (MVP) |
Bucket ?object-lock | GET / PUT (enabled at bucket creation) | Default GOVERNANCE or COMPLIANCE retention on versioned buckets (Preview) |
Object ?retention, ?legal-hold | GET / PUT | Per-version retention and legal hold; governance bypass requires x-amz-bypass-governance-retention: true and s3:BypassGovernanceRetention (Preview) |
Bucket ?lifecycle | GET / PUT / DELETE | Current/noncurrent expiration, expired delete-marker cleanup, and incomplete multipart abort; no remote tiering (Preview) |
Webhook notifications
- Configure a webhook target on the gateway via
MINIO_NOTIFY_WEBHOOK_ENABLE_<ID>=onandMINIO_NOTIFY_WEBHOOK_ENDPOINT_<ID>=https://.... - Attach bucket notification rules referencing
arn:minio:sqs:<region>:<ID>:webhookusingPutBucketNotificationConfigurationormcli 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
AssumeRoleSTS (Preview) accepts a formPOST /signed with an ordinary IAM user’s SigV4 credentials (Action=AssumeRole&Version=2011-06-15).DurationSecondsdefaults to3600(1 hour) and accepts900–31536000seconds (15 minutes to 365 days) unless overridden byMINIO_STS_DURATION. - Service accounts and STS temporary credentials cannot call
AssumeRolerecursively 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 validatedpgsiloscope.
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
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:
- Database owner (
silo_owner): the trusted ordinary PostgreSQL role used bysilo servergateways viaSILO_PG_DSN. - SQL application logins (e.g.,
app_sql): independent unprivileged PostgreSQL roles that callsilo_apifunctions. - 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:
As the installation owner (silo_owner), grant schema USAGE, function EXECUTE, and table privileges on the target bucket’s ACL relation in silo_bucket:
| SQL operation | Required bucket ACL privilege |
|---|---|
stat_object, get_object, read_object, list_objects | SELECT |
put_object (including unconditional overwrite) | INSERT |
Conditional put_object, copy_object, delete_object | Operation privileges plus SELECT |
copy_object | Source SELECT and destination INSERT |
delete_object, drop_bucket | DELETE (drop_bucket also requires an empty bucket) |
bucket_info, list_buckets | At least one of SELECT, INSERT, or DELETE |
create_bucket | EXECUTE 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; PostgreSQLGRANTstatements 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_pgmode.
Bound PostgreSQL roles must be independent ordinary roles (NOLOGIN roles are recommended for S3-only principals) and must not:
- Hold
SUPERUSER,CREATEDB,CREATEROLE,REPLICATION, orBYPASSRLS - Inherit the installation owner (
silo_owner), schema owners,pg_read_all_data, orpg_write_all_data - Hold privileges on the private
siloschema - Hold
WITH GRANT OPTIONonsilo_apifunctions orCREATEonsilo_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:
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 class | Required PostgreSQL privilege in iam_and_pg mode |
|---|---|
Object GET/HEAD, version reads, listings, tag/retention/bucket-config reads | SELECT on bucket ACL relation |
Object PUT, tag writes, retention/legal-hold writes, annotation PUT | INSERT on bucket ACL relation |
Object/version DELETE, AbortMultipartUpload, annotation DELETE | DELETE on bucket ACL relation |
| Bucket configuration changes, governance-retention bypass | UPDATE on bucket ACL relation (plus operation-specific privileges) |
DeleteBucket, ForceDeleteBucket | DELETE and UPDATE on bucket ACL relation |
CreateBucket | EXECUTE on silo_api.create_bucket(text, text) |
Conditional writes/deletes and annotation mutations with x-amz-object-if-match | Operation privilege plus SELECT on bucket ACL relation |
CopyObject | Source 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:
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 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:
| Operation | HTTP request | Required IAM action | Additional bucket privilege (iam_and_pg) |
|---|---|---|---|
| Write or replace | PUT /{bucket}/{key}?annotation=&annotationName=labels.json | s3:PutObjectAnnotation | INSERT |
| Read payload | GET /{bucket}/{key}?annotation=&annotationName=labels.json | s3:GetObjectAnnotation | SELECT |
| List names | GET /{bucket}/{key}?annotation= | s3:ListObjectAnnotations | SELECT |
| Delete | DELETE /{bucket}/{key}?annotation=&annotationName=labels.json | s3:DeleteObjectAnnotation | DELETE |
- Standard
s3:GetObjectands3:PutObjectpermissions do not grant annotation access. IAM policy resources reference the parent object ARN (arn:aws:s3:::bucket/keyor prefix). - The
annotationquery parameter must appear once with an empty value.PUTandDELETErequire a non-emptyannotationName.GETwithoutannotationNamelists all annotations on the selected parent version;GETwithannotationNamereturns that annotation’s body. There is no annotationHEADendpoint. - Successful
PUTreturns HTTP200,DELETEreturns HTTP204, andGETreturnsContent-Type: text/plain; charset=utf-8along with the annotation’s ownETag,Last-Modified, and parentx-amz-version-id.
Size and naming bounds
| Property | Limit |
|---|---|
| Annotations per parent object version | 1000 |
| Plaintext payload size | 1 byte – 1 MiB |
Annotation name (annotationName) | 1 – 512 UTF-8 bytes (no XML-invalid control characters) |
| Payload encoding | Valid 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:
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.
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
CopyObjectacceptsx-amz-annotation-directive: COPY(default) orEXCLUDE. Copying a non-empty annotation set requiress3:GetObjectAnnotationon the source ands3:PutObjectAnnotationon the destination. SQLsilo_api.copy_objectalways copies plaintext annotations atomically and has noEXCLUDEoption. - Encryption: annotations inherit the parent version’s SSE-C or static SSE-S3 protection and require the matching key on
PUTandGET. Public SQL functions have no annotation CRUD endpoints and reject copying objects with encrypted annotations.
Error responses
| Error or status | Meaning |
|---|---|
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
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:
To list archive members, send a ListObjectsV2 request (list-type=2) with x-minio-extract: true and a prefix containing .zip/:
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:GetObjecton the parent.zipobject (ors3:GetObjectVersionwhenversionIdis specified). Listing members additionally requiress3:ListBucket. Underiam_and_pgjoint authorization, onlySELECTon 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
.ziparchives 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
| Parameter | Limit |
|---|---|
| Compression methods | Store (0) and Deflate (8) |
| ZIP64 descriptors | Supported 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 reads | Unsupported (rejected) |
| Password-protected / encrypted ZIP or multi-disk archives | Unsupported (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
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 / operation | Storage behavior |
|---|---|
Unversioned PUT overwrite | Replaces the current unversioned body and unlinks its previous annotation set |
Versioned PUT overwrite | Publishes a new version_id and retains historical versions |
Versioned DELETE without versionId | Inserts a delete marker as the latest version; historical bodies remain stored and count toward quota |
DELETE with explicit versionId | Permanently 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 marker | Standard 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
GOVERNANCEretention requires an S3 request withx-amz-bypass-governance-retention: trueands3:BypassGovernanceRetentionpermission (plusUPDATEon the bucket ACL relation underiam_and_pg). - Neither
COMPLIANCEretention nor an activelegal holdcan be bypassed through S3 or SQL. silo_apiSQL functions inherit default bucket retention onput_object/copy_objectand enforce lock checks ondelete_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
| Path | Behavior |
|---|---|
SSE-C | Client 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 extraction | Inherit 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.
| Operation | Effect on logical bucket quota |
|---|---|
| Overwrite in a versioned bucket | Both the new version and retained old versions count toward quota |
DELETE without versionId in a versioned bucket | Adds a zero-byte delete marker; retained historical versions still count |
DELETE with versionId | Immediately decrements that version’s body bytes and linked annotation bytes |
| Replace or delete an annotation | Immediately applies the net byte difference |
CompleteMultipartUpload | Checks 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:
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 servergateway connected to the PostgreSQL primary—even if applications only usesilo_apiover 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
autovacuumreuse; it does not immediately shrink OS filesystem files. Long-running SQL transactions hold backVACUUMhorizon 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.