<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/recreating-s3-in-postgres-using-postgrest-xgd5ypium" -->

---
title: Recreating S3 in Postgres using PostgREST | daily.dev
description: PostgREST exposes Postgres tables and functions as REST API endpoints, making the database the single source of truth. This walkthrough builds a simple S3-like...
canonical: https://daily.dev/posts/recreating-s3-in-postgres-using-postgrest-xgd5ypium
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Recreating S3 in Postgres using PostgREST | daily.dev
og:description: PostgREST exposes Postgres tables and functions as REST API endpoints, making the database the single source of truth. This walkthrough builds a simple S3-like...
og:url: https://daily.dev/posts/recreating-s3-in-postgres-using-postgrest-xgd5ypium
og:image: https://api.daily.dev/og/posts/xGD5YPium.png
og:image:alt: Recreating S3 in Postgres using PostgREST
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Recreating S3 in Postgres using PostgREST

**[Neon](https://daily.dev/sources/neontech)** · 6 min read · 0 upvotes · 0 comments

## Summary

PostgREST exposes Postgres tables and functions as REST API endpoints, making the database the single source of truth. This walkthrough builds a simple S3-like file server inside Postgres using Neon's Data API. It covers storing binary blobs with metadata, serving files via PostgREST RPC functions with proper MIME types and HTTP headers, and securing access with Row-Level Security policies and JWT-based authentication. Anonymous users can only access public files, while authenticated users can access their own private blobs. The post also highlights the importance of configuring RLS correctly when using the Neon Data API.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://neon.com/blog/recreating-s3-in-postgres-using-postgrest>

## Similar posts on daily.dev

- [Building Neon Object Storage](https://daily.dev/posts/building-neon-object-storage-o1dc0zj6r) · Neon · 13 upvotes · 3 comments
- [Building a private, searchable photo library on the Neon backend](https://daily.dev/posts/building-a-private-searchable-photo-library-on-the-neon-backend-yoxuf0nql) · Neon · 1 upvotes · 0 comments
- [When a file is uploaded, run the job on Neon](https://daily.dev/posts/when-a-file-is-uploaded-run-the-job-on-neon-r0fjcimoy) · Neon · 12 upvotes · 1 comments
- [Integrating Postgres and Auth the Easy Way: Daisy’s Neon Setup](https://daily.dev/posts/integrating-postgres-and-auth-the-easy-way-daisy-s-neon-setup-2kwtolnxo) · Neon · 0 upvotes · 0 comments
- [The Neon backend is GA: a complete set of primitives so agents can build](https://daily.dev/posts/the-neon-backend-is-ga-a-complete-set-of-primitives-so-agents-can-build-ueg1c5mpg) · Neon · 7 upvotes · 0 comments

---

Tags: [#postgresql](https://daily.dev/tags/postgresql)

[View this post on daily.dev](https://daily.dev/posts/recreating-s3-in-postgres-using-postgrest-xgd5ypium)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Recreating S3 in Postgres using PostgREST","url":"https://daily.dev/posts/recreating-s3-in-postgres-using-postgrest-xgd5ypium","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/recreating-s3-in-postgres-using-postgrest-xgd5ypium"},"datePublished":"2026-07-09T06:58:05.653Z","dateModified":"2026-07-09T07:03:43.508Z","description":"PostgREST exposes Postgres tables and functions as REST API endpoints, making the database the single source of truth. This walkthrough builds a simple S3-like...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/7a1bfb6cd7871fb127536b92e1afa130?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/7a1bfb6cd7871fb127536b92e1afa130?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Neon","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Neon","logo":"https://media.daily.dev/image/upload/s--65EDghou--/f_auto/v1724339118/logos/neontech","url":"https://daily.dev/sources/neontech"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/recreating-s3-in-postgres-using-postgrest-xgd5ypium","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"postgresql","timeRequired":"PT6M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Neon","item":"https://daily.dev/sources/neontech"},{"@type":"ListItem","position":3,"name":"Recreating S3 in Postgres using PostgREST"}]}
```

