Intro Postgreql

De WikiEducator
Saltar a: navegación, buscar



Primeros pasos

Icon preknowledge.gif

Primeros pasos

# para instalar postgresql en ubuntu
$sudo nano /etc/apt/sources.list 
 
  deb http://ppa.launchpad.net/pitti/postgresql/ubuntu precise main 
  deb-src http://ppa.launchpad.net/pitti/postgresql/ubuntu precise main 
 
 
$sudo apt-key adv –keyserver keyserver.ubuntu.com –recv-keys 8683D8A2 
$sudo apt-get update
  sudo apt-get install postgresql pgadmin3
  sudo -u postgres psql
  /password
 
  postgres=# alter user postgres with password 'nueva contraseña';




Creación de usuario, tabla y extensiones

 sudo -u postgres createuser myusername
 Shall the new role be a superuser? (y/n) y
 
 createdb book
 
 psql book -c "CREATE EXTENSION tablefunc" 
 ERROR:  could not open extension control file "/usr/share/postgresql/9.1/extension/tablefunc.control": No such file or directory
 
 sudo apt-get install postgresql-contrib 
 
 psql book -c "CREATE EXTENSION tablefunc" 
 psql book -c "CREATE EXTENSION fuzzystrmatch" 
 psql book -c "CREATE EXTENSION pg_trgm" 
 psql book -c "CREATE EXTENSION cube" 
 psql book -c "CREATE EXTENSION dict_xsyn"

Configuración postgresql


Migración de mysql a postgresql