Difference between revisions of "Sudo -u postgres"

From wikieduonline
Jump to navigation Jump to search
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
 
{{lc}}
 
{{lc}}
 
  [[sudo -u postgres psql]]
 
  [[sudo -u postgres psql]]
 +
 +
 +
[[sudo -u postgres]] -- bash -c "psql -c 'CREATE database tsdb'"
 +
sudo -u postgres -- bash -c "psql tsdb -c 'CREATE EXTENSION IF NOT EXISTS timescaledb;'"
 +
 +
[[EOF]]
 +
[[psql -c]]
 +
 +
 +
{{psql}}

Latest revision as of 16:08, 2 February 2023

sudo -u postgres psql


sudo -u postgres -- bash -c "psql -c 'CREATE database tsdb'"
sudo -u postgres -- bash -c "psql tsdb -c 'CREATE EXTENSION IF NOT EXISTS timescaledb;'"

EOF

psql -c


PostgreSQL: psql, .psqlrc, .pgpass, $HOME/.pg service.conf, -U, -W, -d, meta-commands: \du, \dg, \ddp, \dp, \list, \dn, \dt, \c, \l, \di, \q, show users, show, su - postgres, psql -c, \?, \connect, \conninfo, --version, --help, PL/pgSQL

Advertising: