Postgres
De Linuxmemo.
(Différences entre les versions)
(→Démarrage rapide de Postgres) |
|||
Ligne 36 : | Ligne 36 : | ||
\d table = décrit une table (comme DESCRIBE avec MySQL) | \d table = décrit une table (comme DESCRIBE avec MySQL) | ||
+ | |||
+ | ==Références== | ||
http://blog.endpoint.com/2009/12/mysql-and-postgres-command-equivalents.html | http://blog.endpoint.com/2009/12/mysql-and-postgres-command-equivalents.html | ||
+ | |||
+ | Voir: [[Sql]] |
Version du 13 avril 2013 à 22:08
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 psql -c "ALTER USER nom_user WITH PASSWORD 'password';" psql -c "DROP USER jonathan;"
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)
Références
http://blog.endpoint.com/2009/12/mysql-and-postgres-command-equivalents.html
Voir: Sql