Install and Configure PostgreSQL for a Project
Install and configure PostgreSQL from scratch with database creation, users, application connection, and first SQL queries.
Paste in your AI
Paste this prompt in ChatGPT, Claude or Gemini and customize the variables in brackets.
Tu es un formateur en développement web spécialisé dans les bases de données pour débutants. Je dois installer et configurer PostgreSQL pour mon premier projet et je ne sais pas par où commencer.
Mon contexte :
- OS : [EX: macOS avec Homebrew, Ubuntu 22.04, Windows 11]
- Projet : [EX: application Node.js avec Express, application Python avec Django, application React]
- Objectif : [EX: développement local uniquement, préparation pour le déploiement]
Guide-moi étape par étape :
-
Installation : commandes exactes pour installer PostgreSQL sur mon OS. Explique ce qui est installé et pourquoi.
-
Premiers pas avec psql : comment démarrer le service, me connecter avec psql, les commandes de base (\l, \c, \dt, \d table).
-
Créer ma base de données : créer une base de données et un utilisateur dédié pour mon projet (pas utiliser postgres en production), avec les permissions appropriées.
-
Créer mes premières tables : une ou deux tables simples avec les types de données courants (VARCHAR, INTEGER, BOOLEAN, TIMESTAMP, TEXT), les contraintes (NOT NULL, UNIQUE, PRIMARY KEY, FOREIGN KEY).
-
Connexion depuis mon application : montre comment connecter PostgreSQL depuis [Node.js avec pg ou Prisma / Python avec psycopg2 ou SQLAlchemy] avec les bonnes pratiques (pool de connexions, variables d'environnement).
-
Sécurité basique : mots de passe forts, ne jamais exposer PostgreSQL sur internet, .env pour les credentials.
-
Commandes utiles : les 10 commandes SQL les plus utiles pour débuter (SELECT, INSERT, UPDATE, DELETE, JOIN simple).
Explique chaque étape clairement et indique les erreurs courantes à éviter.
Personalize this prompt with Léa
Answer 3 questions and Léa tailors the prompt to your situation.
Why this prompt works
<p>This prompt is calibrated for complete beginners with PostgreSQL by requesting explanations for each command, not just syntax. Creating a dedicated project user (rather than using the postgres superuser) is a fundamental security best practice that beginner tutorials often omit.</p><p>Integrating the application connection in the same prompt is valuable because it's the step where beginners get stuck most often: having the database installed and configured is useless if you don't know how to connect to it from your code.</p><p>The basic security section, even simplified for beginners, establishes good habits from the start: never hardcode credentials in code, never publicly expose the PostgreSQL port. These habits formed early in learning prevent costly security incidents later.</p>
Use Cases
Expected Output
A complete installation guide with exact commands, secure configuration, database and table creation, application connection, and basic SQL commands.
Learn more
Check the full skill on Prompt Guide to master this technique from A to Z.
View on Prompt GuideComments
Be the first to comment on this prompt.
📬 Get new prompts every week
Join our newsletter and never miss a prompt.
Similar Prompts
Write Integration Tests for an API
Create complete API integration tests with database setup, authentication, CRUD, and end-to-end scenarios.
Set Up Application Observability
Implement the three pillars of observability (logs, metrics, traces) with OpenTelemetry, Prometheus, and Grafana dashboards.
DALL-E Prompt to Generate JavaScript Code
DALL-E, the image generation model developed by OpenAI, is not designed to produce executable JavaScript code. However, it can play a valuable complementary role in a JavaScript developer's workflow. DALL-E excels at creating visuals related to development: user interface mockups, architecture diagrams, data flow schemas, or illustrations to document your code. By crafting precise prompts, you can obtain visual representations of complex JavaScript concepts like closures, the event loop, or design patterns. These visuals then serve as references for implementing your code, creating attractive technical documentation, or designing educational materials. The approach is to use DALL-E as a rapid visual prototyping tool: generate a UI mockup, then translate it into JavaScript components. This method accelerates the design phase and reduces back-and-forth between designers and developers. In this guide, we offer optimized prompts to get the most out of DALL-E in your JavaScript development process, from UI prototyping to visual documentation of your code.
Debug Your Python Code with ChatGPT
A structured prompt to get a complete analysis of your Python bugs: identification, root cause explanation, commented fix, and prevention tips.