This project is a fun PostgreSQL C extension that generates an ASCII art design when called. It demonstrates how to create a simple PostgreSQL extension using C, showcasing the extensibility of PostgreSQL.
- Docker
- PostgreSQL development tools
- Base Image:
postgres:17
- Development Isolation: Containerized PostgreSQL environment
# Create and start the PostgreSQL container
docker run -d \
--name chillguy-postgres \
-p 5432:5432 \
-e POSTGRES_PASSWORD=mysecretpassword \
postgres:17
# Connect using psql
psql -U postgres -h localhost -p 5432
chillguy/
├── Dockerfile
├── Makefile
├── chillguy.control
├── chillguy.c
└── chillguy--0.0.1.sql
# Enter the PostgreSQL container
docker exec -it chillguy-postgres bash
# Install development libraries
apt-get update && apt-get install -y postgresql-server-dev-17 build-essential
These tools are necessary for building C extensions in PostgreSQL.
# Copy extension files to the container
docker cp ./chillguy postgres:/path/to/extension
# Build and install the extension
cd /path/to/extension
make
make install
- Create the extension:
CREATE EXTENSION chillguy;
- Call the function to display ASCII art:
SELECT chillguy();
- PostgreSQL extension development with Docker
- Creating C functions in PostgreSQL
- Containerized database development
- Add more ASCII art designs
- Implement design variations
- Create randomization logic
- Ensure Docker is running
- Check port 5432 is not in use
- Verify PostgreSQL container is up
Contributions, creative ASCII art, and feature requests are welcome!
- PostgreSQL Version: 17
- Development Environment: Docker
- Connection:
psql -U postgres -h localhost -p 5432