Install PostgeSQL in WSL2
Add or connect a database with WSL | Microsoft Learn
Common command
\l: list all db\dt: list all table in dbcreatdb: create DB\q: Exit psql shell\h+COMMAND: help(ex: \h create table)\c DB: Change DB
Architectural Fundamentals
In database jargon, PostgreSQL uses a client/server model. A PostgreSQL session consists of the following cooperating processes (programs):
-
A server process, which manages the database files, accepts connections to the database from client applications, and performs database actions on behalf of the clients. The database server program is called
postgres. -
The user’s client (frontend) application that wants to perform database operations. Client applications can be very diverse in nature: a client could be a text-oriented tool, a graphical application, a web server that accesses the database to display web pages, or a specialized database maintenance tool. Some client applications are supplied with the PostgreSQL distribution; most are developed by users.
They communicate over IP network connection.