Configure mc, rclone, Python boto3, DuckDB httpfs, and s3fs to talk to pgs3. Every client needs three settings: SigV4 signing, path-style addressing, and an explicit endpoint URL.
Any S3 client that speaks AWS Signature Version 4 and path-style URLs (http://host:9000/bucket/key) works against pgs3. Because pgs3 does not implement virtual-host routing (http://bucket.host:9000/key), always disable virtual-host addressing in your client configuration.
All examples below reuse the shell variables from Getting started (or your production HTTPS proxy URL and tenant credentials):
mc (packaged as mcli on some Linux distributions) is the fastest day-to-day CLI for buckets, objects, directory mirrors, version history, and presigned download links.
Configure an alias
Pass --api S3v4 --path on so mc always signs with SigV4 and sends path-style requests:
mc aliasset pgs3 "$PGS3_ENDPOINT""$PGS3_ACCESS_KEY""$PGS3_SECRET_KEY" --api S3v4 --path on
mc ls pgs3
Everyday object operations
# Create a bucket and upload with Content-Type and custom metadatamc mb "pgs3/$PGS3_BUCKET"printf'hello pgs3\n' > hello.txt
mc cp --attr "Content-Type=text/plain;owner=docs" hello.txt "pgs3/$PGS3_BUCKET/notes/hello.txt"# Inspect metadata, read content, and list a prefixmc stat "pgs3/$PGS3_BUCKET/notes/hello.txt"mc cat "pgs3/$PGS3_BUCKET/notes/hello.txt"mc ls "pgs3/$PGS3_BUCKET/notes/"# Server-side copy (reuses the underlying SHA-256 blob without re-uploading)mc cp "pgs3/$PGS3_BUCKET/notes/hello.txt""pgs3/$PGS3_BUCKET/archive/hello.txt"# Mirror a local directory into a dedicated prefixmc mirror ./reports "pgs3/$PGS3_BUCKET/reports"
Work with object versions
pgs3 keeps versioning permanently enabled on every bucket:
# List every revision and delete marker for a keymc ls --versions "pgs3/$PGS3_BUCKET/notes/hello.txt"# Read or download a specific historical versionmc cat --version-id 1"pgs3/$PGS3_BUCKET/notes/hello.txt"mc cp --version-id 1"pgs3/$PGS3_BUCKET/notes/hello.txt" ./hello-v1.txt
# Ordinary delete (writes a delete marker; earlier versions remain intact)mc rm "pgs3/$PGS3_BUCKET/notes/hello.txt"# Permanent delete of a single versionmc rm --version-id 1"pgs3/$PGS3_BUCKET/notes/hello.txt"
Generate a temporary download URL
mc share download signs a presigned GET URL locally without calling any extra API:
mc share download --expire=10m "pgs3/$PGS3_BUCKET/archive/hello.txt"
Note
MinIO-specific and unsupported S3 subcommands (mc admin, mc anonymous, mc ilm, mc retention, mc tag) are outside the pgs3 API subset and return 501 NotImplemented.
rclone
rclone is part of the pgs3 release acceptance matrix and works well for automated sync jobs, integrity verification, and large multipart transfers.
To avoid storing secrets in a config file, replace access_key_id and secret_access_key with env_auth = true and export AWS_ACCESS_KEY_ID / AWS_SECRET_ACCESS_KEY, or configure the remote purely with environment variables (RCLONE_CONFIG_PGS3_TYPE=s3, RCLONE_CONFIG_PGS3_PROVIDER=Other, RCLONE_CONFIG_PGS3_ENDPOINT, RCLONE_CONFIG_PGS3_FORCE_PATH_STYLE=true, RCLONE_CONFIG_PGS3_REGION=us-east-1, plus access/secret keys).
Sync, verify, and restore
# Create a bucket (idempotent if you already own it)rclone mkdir "pgs3:$PGS3_BUCKET"# Mirror a local folder into a dedicated prefixrclone sync ./reports "pgs3:$PGS3_BUCKET/reports" --checkers 4 --transfers 4# Verify byte-for-byte integrity by downloading and comparing hashesrclone check --download ./reports "pgs3:$PGS3_BUCKET/reports"# Download back to a local directoryrclone copy "pgs3:$PGS3_BUCKET/reports" ./reports-restored
Warning
Only run rclone sync against a dedicated destination prefix. Any object under that destination prefix that does not exist in the local source directory receives a delete marker.
Python (boto3)
Set signature_version="s3v4" and addressing_style="path" in botocore.config.Config. Large files automatically use multipart upload (every non-final part must be at least 5 MiB).
Upload, conditional writes, and download
importosimportboto3frombotocore.configimportConfigs3=boto3.client("s3",endpoint_url=os.environ["PGS3_ENDPOINT"],aws_access_key_id=os.environ["PGS3_ACCESS_KEY"],aws_secret_access_key=os.environ["PGS3_SECRET_KEY"],region_name="us-east-1",config=Config(signature_version="s3v4",s3={"addressing_style":"path"},retries={"max_attempts":3},request_checksum_calculation="when_supported",response_checksum_validation="when_supported",),)bucket=os.environ["PGS3_BUCKET"]# Create only if the key does not exist yet (returns 412 PreconditionFailed otherwise)put_res=s3.put_object(Bucket=bucket,Key="python/config.json",Body=b'{"mode":"v1"}\n',ContentType="application/json",Metadata={"service":"worker"},IfNoneMatch="*",)etag=put_res["ETag"]# Compare-and-swap update guarded by the current ETags3.put_object(Bucket=bucket,Key="python/config.json",Body=b'{"mode":"v2"}\n',ContentType="application/json",IfMatch=etag,)# Read back the latest revisionobj=s3.get_object(Bucket=bucket,Key="python/config.json")assertobj["Body"].read()==b'{"mode":"v2"}\n'
Presigned GET and PUT URLs
Presigned URLs delegate temporary read or write access to browsers or untrusted workers without sharing the tenant secret. They enforce the exact HTTP method, path, query string, expiry, and the underlying PostgreSQL role’s RLS visibility.
importurllib.requestput_url=s3.generate_presigned_url("put_object",Params={"Bucket":bucket,"Key":"python/upload.txt"},ExpiresIn=300,)get_url=s3.generate_presigned_url("get_object",Params={"Bucket":bucket,"Key":"python/upload.txt"},ExpiresIn=300,)req=urllib.request.Request(put_url,data=b"uploaded via presigned PUT\n",method="PUT")withurllib.request.urlopen(req)asresp:assertresp.status==200withurllib.request.urlopen(get_url)asresp:assertresp.read()==b"uploaded via presigned PUT\n"
Always distribute presigned URLs over HTTPS through a TLS-terminating proxy in production.
DuckDB (httpfs)
DuckDB can query Parquet, CSV, or JSON files stored inside pgs3 over range-capable HTTP GET requests.
Generate a Parquet file and upload it with mc:
duckdb -c "COPY (SELECT i AS id, 'row-' || i AS label FROM range(100) t(i)) TO 'sample.parquet' (FORMAT PARQUET)"mc cp sample.parquet "pgs3/$PGS3_BUCKET/analytics/sample.parquet"
Query it directly from DuckDB (ENDPOINT expects host:port without a scheme; set USE_SSL true behind a TLS proxy):
On Linux hosts with /dev/fuse and fusermount3, you can mount a pgs3 bucket as a local directory for legacy tools that only read and write filesystem paths:
s3fs translates renames and in-place edits into multiple S3 API calls and does not provide POSIX file locking or atomic directory moves. Do not place databases, Git repositories, or lock-sensitive workloads on an s3fs mount.