User Tools

Site Tools


postgresql

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
postgresql [2026/06/14 12:36] – [Installation] jhagstrandpostgresql [2026/07/31 05:32] (current) – [Use] jhagstrand
Line 6: Line 6:
   sudo apt update   sudo apt update
   sudo apt install postgresql postgresql-contrib postgis postgresql-16-postgis-3   sudo apt install postgresql postgresql-contrib postgis postgresql-16-postgis-3
 +  
   sudo -u postgres psql   sudo -u postgres psql
   CREATE USER devuser WITH PASSWORD 'devpass';   CREATE USER devuser WITH PASSWORD 'devpass';
Line 12: Line 12:
   \c myapp   \c myapp
   CREATE EXTENSION postgis;   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 = 'mai';
 +  
 +  SELECT column_name, data_type FROM INFORMATION_SCHEMA.COLUMNS WHERE table_name = 'mai';
 +  
 +  select table_schema, table_name from information_schema.tables where table_schema not in ('public','pg_catalog','information_schema') group by table_schema, table_name order by table_schema,table_name;
  
postgresql.1781454991.txt.gz · Last modified: 2026/06/14 12:36 by jhagstrand

Except where otherwise noted, content on this wiki is licensed under the following license: Public Domain
Public Domain Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki