postgresql

Ceci est une ancienne révision du document !


autoriser l'authentification par login / password

vim /etc/postgresql/x.x/main/pg_hba.conf
commenter
# “local” is for Unix domain socket connections only
#local all all peer

ajouter
local all all md5
host all all 127.0.0.1/32 md5
host all all ::1/128 md5

service postgresql restart

créer un utilisateur (admin si besoin)

sudo -i -u postgres
createuser -P –interactive <nom_utilisateur>


import / export

sudo -i -u postgres
pg_dump <nom_de_la_base> > nom_de_la_base.pgdump ## export
cat nom_de_la_base.pgdump | psql -d nom_de_la_base
## import

  • postgresql.1576077973.txt.gz
  • Dernière modification: 2023/05/08 01:41
  • (modification externe)