Postgres

De Linuxmemo.

(Différences entre les versions)
(Page créée avec « Catégorie:Logiciel Bases de données: === Démarrage rapide de Postgres === ./configure gmake su gmake install adduser postgres mkdir /usr/local/pgsql/data cho... »)
Ligne 33 : Ligne 33 :
  \i fichier.sql = lit les instructions du fichier fichier.sql
  \i fichier.sql = lit les instructions du fichier fichier.sql
  \d table = décrit une table (comme DESCRIBE avec MySQL)
  \d table = décrit une table (comme DESCRIBE avec MySQL)
 +
 +
http://blog.endpoint.com/2009/12/mysql-and-postgres-command-equivalents.html

Version du 30 août 2012 à 20:45


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 

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

Outils personnels