postgresql

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Prochaine révision
Révision précédente
postgresql [2019/05/27 16:53] – créée 88.167.136.11postgresql [2023/05/08 01:41] (Version actuelle) – modification externe 127.0.0.1
Ligne 1: Ligne 1:
 ====PostGreSQL==== ====PostGreSQL====
 -> https://doc.ubuntu-fr.org/postgresql#creer_un_utilisateur_postgresql -> https://doc.ubuntu-fr.org/postgresql#creer_un_utilisateur_postgresql
 +\\ 
  
-===autoriser l'authentification mar login / password===+===autoriser l'authentification par login / password===
 ''vim /etc/postgresql/x.x/main/pg_hba.conf'' ''vim /etc/postgresql/x.x/main/pg_hba.conf''
 +commenter
 +''# "local" is for Unix domain socket connections only
 +#local   all             all                                     peer''
 ajouter ajouter
 ''local   all             all                                     md5 ''local   all             all                                     md5
Ligne 9: Ligne 13:
 host    all             all             ::1/128                 md5'' host    all             all             ::1/128                 md5''
 ''service postgresql restart'' ''service postgresql restart''
 +\\ 
  
 ===créer un utilisateur (admin si besoin)=== ===créer un utilisateur (admin si besoin)===
 ''sudo -i -u postgres ''sudo -i -u postgres
 createuser -P --interactive <nom_utilisateur>'' 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
 +\\ 
 +
 +===donner tous les droits sur une base===
 +''su - postgres
 +psql
 +\c <USER>
 +GRANT ALL
 +ON ALL TABLES IN SCHEMA public 
 +TO <USER>;''
  • postgresql.1558968816.txt.gz
  • Dernière modification: 2023/05/08 01:41
  • (modification externe)