¿Has sentido ganas de compilar PostgreSQL 9-beta-1? ¿Tienes ese impulso de pasión por descubrir que trae de nuevo?
Puedes hacerlo en X sencillos pasos:
- Descarga las fuentes: http://www.postgresql.org/ftp/source/v9.0beta1/
- Luego de descargar, descomprimir con su herramienta favorita (tar -xvvzf o tar -xvvjf por nombrar un ejemplo)
- Moverse al directorio que se acaba de crear (postgresql-9.0beta1) y revisar las opciones de compilación (./configure –help)
- Instalar librerías necesarias, de acuerdo con lo que se desee habilitar:
libreadline-dev (Opcional, podrias usar –without-readline (revisar este link)
libpam-dev (–with-pam)
libxml2-dev (–with-xml)
Soporte para lenguajes procedimentales o PL
perl-dev (–with-perl)
python-dev (–with-python)
- finalmente:
./configure –with-pgport=5433 –with-perl –with-python –with-pam –with-openssl –with-libxml –prefix=$(pwd)/../pg9
- make && make:
- Al final del make veras un mensaje similar a este: All of PostgreSQL successfully made. Ready to install
- Al final del make install veras otro mensaje similar: PostgreSQL installation complete.
- A jugar!: PGDATA=$(pwd)/pg_data bin/initdb
Luego de todo esto, deberías tener una salida similar a esta:
foursixnine@quaoar:~/proyectos/postgresql/pg9$ PGDATA=$(pwd)/pg_data bin/initdb
The files belonging to this database system will be owned by user “foursixnine”.
This user must also own the server process.
The database cluster will be initialized with locale es_VE.UTF-8.
The default database encoding has accordingly been set to UTF8.
The default text search configuration will be set to “spanish”.
fixing permissions on existing directory /home/foursixnine/proyectos/postgresql/pg9/pg_data … ok
creating subdirectories … ok
selecting default max_connections … 100
selecting default shared_buffers … 28MB
creating configuration files … ok
creating template1 database in /home/foursixnine/proyectos/postgresql/pg9/pg_data/base/1 … ok
initializing pg_authid … ok
initializing dependencies … ok
creating system views … ok
loading system objects’ descriptions … ok
creating conversions … ok
creating dictionaries … ok
setting privileges on built-in objects … ok
creating information schema … ok
loading PL/pgSQL server-side language … ok
vacuuming database template1 … ok
copying template1 to template0 … ok
copying template1 to postgres … ok
WARNING: enabling “trust” authentication for local connections
You can change this by editing pg_hba.conf or using the -A option the
next time you run initdb.
Success. You can now start the database server using:
bin/postgres -D /home/foursixnine/proyectos/postgresql/pg9/pg_data
or
bin/pg_ctl -D /home/foursixnine/proyectos/postgresql/pg9/pg_data -l logfile start
Si todo va bien… ¡Felicitaciones, ya tienes instalado PostgreSQL en tu sistema (en mi caso, lo instale dentro de mi usuario, para no tener que estar usando sudo, o crear un script de inicio siempre…). Para verificar que esta todo bien:
foursixnine@quaoar:~/proyectos/postgresql/pg9$ bin/psql –port 5433 postgres
psql (9.0beta1)
Type “help” for help.
postgres=#
postgres=# q
foursixnine@quaoar:~/proyectos/postgresql/pg9$ bin/createlang -p 5433 -d postgres plperl
foursixnine@quaoar:~/proyectos/postgresql/pg9$ bin/createlang -p 5433 -d postgres plpythonu
foursixnine@quaoar:~/proyectos/postgresql/pg9$ bin/createlang -l -p 5433 postgres
Procedural Languages
Name | Trusted?
———–+———-
plpgsql | yes
plperl | yes
plpythonu | no