Postgres
De Linuxmemo.
(Différences entre les versions)
Ligne 20 : | Ligne 20 : | ||
sous bash | sous bash | ||
su - postgres | su - postgres | ||
- | createuser root | + | createuser root |
+ | ALTER USER nom_user WITH PASSWORD 'password'; | ||
=== Commandes du client "psql" === | === Commandes du client "psql" === |
Version du 31 août 2012 à 07:12
Bases de données:
Démarrage rapide de Postgres
./configure gmake su gmake install adduser postgres mkdir /usr/local/pgsql/data chown postgres /usr/local/pgsql/data su - postgres /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data /usr/local/pgsql/bin/postgres -D /usr/local/pgsql/data >logfile 2>&1 & /usr/local/pgsql/bin/createdb test /usr/local/pgsql/bin/psql test
sous bash su - postgres createuser root ALTER USER nom_user WITH PASSWORD 'password';
Commandes du client "psql"
\l = liste des bases \c nombase = connexion a la base nombase \d = liste des tables \q = quitter \h = aide SELECT version(); = version PostgreSQL SELECT current_date; = date actuelle \i fichier.sql = lit les instructions du fichier fichier.sql \d table = décrit une table (comme DESCRIBE avec MySQL)
http://blog.endpoint.com/2009/12/mysql-and-postgres-command-equivalents.html