Setting up VS Code dev containers for pgrx PostgreSQL extensions requires careful attention to three key issues: running as a non-root user (since PostgreSQL refuses to run as root), ensuring cargo files are owned by the runtime user to avoid permission errors, and initializing pgrx at container runtime rather than image build
Table of contents
A quick storyThe PostgreSQL root problemThe cargo permission trapThe pgrx state persistence problemBonus: Docker-in-Docker and testcontainersThe final working configuration (condensed)Short troubleshooting checklistTakeawaysFinal wordsSort: