Basic
PostgreSQL
Introduction
PostgreSQL is a powerful, open source object-relational database system.
If you don’t know how an SQL database works, start with the activities in Sqlite.
Docker
Start a Linux virtual machine with Windows Subsystem for Linux (WSL).
Install docker as explained in Docker.
Create a new container running postgres:
psql
psql is a shell for PostgreSQL that lets you write queries interactively, send them to PostgreSQL, and view the results.
Create a new terminal session in the container:
Start a session with the user postgres:
A Postgres server can manage several databases at the same time.
Use the command \l (or \list) to see all databases defined on the server,
postgres=# \l
List of databases
Name | Owner | Encoding | Locale Provider | Collate | Ctype | Locale | ICU Rules | Access privileges
-----------+----------+----------+-----------------+---------+-------+--------+-----------+-----------------------
postgres | postgres | UTF8 | libc | C | en | | |
template0 | postgres | UTF8 | libc | C | en | | | =c/postgres +
| | | | | | | | postgres=CTc/postgres
template1 | postgres | UTF8 | libc | C | en | | | =c/postgres +
| | | | | | | | postgres=CTc/postgres
(3 rows)Estàs llegint una vista prèvia.
Inicia sessió per llegir l'article complet. Qualsevol compte obre 4 articles gratuïts al mes; l'alumnat i el professorat llegeixen les pàgines del seu curs sense límit.
Inicia sessió