Diferencia entre revisiones de «Usuario:Lmorillas/postgresql»

De WikiEducator
Saltar a: navegación, buscar
(Página creada con '{{MiTitulo|Intro Postgreql}} {{Conocimiento previo|Title=Primeros pasos| * http://www.postgresql.org.es/documentacion sudo apt-get install postgresql pgadmin3 sudo -u po…')
 
 
(3 revisiones intermedias por el mismo usuario no mostrado)
Línea 2: Línea 2:
  
  
{{Conocimiento previo|Title=Primeros pasos|
+
{{Conocimiento previo|Title=Primeros pasos|TOCdepth=2|
  
 
* http://www.postgresql.org.es/documentacion
 
* http://www.postgresql.org.es/documentacion
  
 +
<source lang="bash">
 +
# 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
 +
</source>
 +
 +
<source lang="bash">
 
   sudo apt-get install postgresql pgadmin3
 
   sudo apt-get install postgresql pgadmin3
 
   sudo -u postgres psql
 
   sudo -u postgres psql
 
   /password
 
   /password
  
 +
  postgres=# alter user postgres with password 'nueva contraseña';
 +
</source>
 
}}
 
}}
 +
 +
 +
== Creación de usuario, tabla y extensiones ==
 +
<source lang="bash">
 +
 +
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"
 +
 +
</source>
 +
 +
== Configuración postgresql ==
 +
* http://tubasededatoslibre.org/site/instalacion-de-postgresql-en-debian-gnulinux-squeeze/
 +
 +
 +
== Migración de mysql a postgresql ==
 +
* http://www.latindevelopers.com/articulos/misc/migrar-de-mysql-a-postgresql.php

Última revisión de 20:20 27 nov 2012



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