postgresql
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| postgresql [2026/06/14 12:34] – created jhagstrand | postgresql [2026/07/31 05:32] (current) – [Use] jhagstrand | ||
|---|---|---|---|
| Line 3: | Line 3: | ||
| ===== Installation ===== | ===== Installation ===== | ||
| - | sudo apt update | ||
| - | sudo apt install postgresql postgresql-contrib postgis postgresql-16-postgis-3 | ||
| - | sudo -u postgres psql | + | sudo apt update |
| - | CREATE USER devuser WITH PASSWORD ' | + | sudo apt install postgresql postgresql-contrib postgis postgresql-16-postgis-3 |
| - | CREATE DATABASE myapp OWNER devuser; | + | |
| - | \c myapp | + | |
| - | CREATE EXTENSION postgis; | + | CREATE USER devuser WITH PASSWORD ' |
| + | CREATE DATABASE myapp OWNER devuser; | ||
| + | \c myapp | ||
| + | CREATE EXTENSION postgis; | ||
| + | |||
| + | ===== Use ===== | ||
| + | |||
| + | psql -U voyccom_jhagstrand -d voyccom_mai | ||
| + | (password is in .pgpass) | ||
| + | | ||
| + | \h list SQL commands | ||
| + | \? list psql commands | ||
| + | \dt list tables in public schema | ||
| + | | ||
| + | SELECT * FROM information_schema.tables WHERE table_schema = ' | ||
| + | | ||
| + | SELECT column_name, | ||
| + | | ||
| + | select table_schema, | ||
postgresql.1781454862.txt.gz · Last modified: 2026/06/14 12:34 by jhagstrand