Agras Zeta Atino

Un blog mas de tecnologia, locuras y procrastinacion

PostgreSQL and HTTP tools

Today i’ve read at Planet Postgres a post about an interesting tool which is meant to use Http as way of comunication to a postgresql database and json as return datatype, its name is pg_httpd.

Have a look at the comments, they’re very interesting, and the project looks very helpful.

This also made me remember of another tool, HTSQL, this is basicly the same, just a little more robust and written in Python. I’ts aim is basicly the same, just provide a simple way to access data stored in postgresql (Although HTSQL supports as many databases as your python’s database drivers installed). the great thing is that it even comes with fancy stuff to even create graphics.

HTSQL supports graphics, different output types and so on (You can take a look at their extensive tutorial here.

Again, both projects are extremely useful, just depending on what you need, you’d use one or the other (Or none).

Compilando PostgreSQL 9 Beta 1

¿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:

  1. Descarga las fuentes:  http://www.postgresql.org/ftp/source/v9.0beta1/
  2. Luego de descargar, descomprimir con su herramienta favorita (tar -xvvzf o tar -xvvjf por nombrar un ejemplo)
  3. Moverse al directorio que se acaba de crear (postgresql-9.0beta1) y revisar las opciones de compilación (./configure –help)
  4. 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)

  5. finalmente:

    ./configure –with-pgport=5433 –with-perl –with-python –with-pam –with-openssl –with-libxml –prefix=$(pwd)/../pg9

  6. make && make:
  7. Al final del make veras un mensaje similar a este: All of PostgreSQL successfully made. Ready to install
  8. Al final del make install veras otro mensaje similar: PostgreSQL installation complete.
  9. 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

El primer Beta de PostgreSQL 9 ha sido liberado

El primer beta de la versión 9.0 de PostgreSQL
está ahora disponible. La versión 9.0 es la primera versión de
PostgreSQL que incluye replicación binaria, en tiempo real, integrada
y con capacidad de responder consultas en la réplica, este tipo de
replicación consiste en dos características: “Hot Standby” y
“Streaming Replication”. Combinando esto con las otras características
que se incluyen, está nueva versión permitirá expandir la adopción de
PostgreSQL por nuevos usuarios y en nuevos tipos de aplicaciones.

Esta es una versión beta. Eso significa que se espera que tenga
errores, inconvenientes y documentación incompleta. 9.0 beta está
siendo liberado para que nuestros usuarios puedan encontrar esos
inconvenientes y nos permitan eliminarlos antes del lanzamiento final.
El Grupo Global de Desarrollo de PostgreSQL requiere que todos los
usuarios de PostgreSQL descarguen y prueben la versión 9.0 beta para
ayudarnos a producir en un tiempo razonable una versión 9.0 libre de
problemas.

En la versión 9.0, una gran cantidad de nuevas características y
mejoras permitirán a desarrolladores y DBAs ampliar su uso de
PostgreSQL; estas incluyen:

* Nueva replicación binaria
* Soporte para 64-bit en Windows
* Un LISTEN/NOTIFY mejorado permite notificar los eventos de la
base de datos de forma más rápida
* Bloques de procedimientos anónimos con la sentencia DO
* Triggers condicionales y triggers por columnas, estos últimos se
ajustan al estándar SQL
* Soporte para Python 3 en PL/Python y numerosas mejoras en PL/Perl
* Restricciones de unicidad para datos no escalares (exclusion constraints)
* Se mejoró el soporte para datos del tipo llave-valor
* Remoción automática de joins, esto permitirá optimizar consultas
generadas por sistemas ORM

La lista completa de más de 200 cambios está disponible en las notas
de versión: http://developer.postgresql.org/pgdocs/postgres/release-9-0.html

Usuarios interesados en sacarle el mayor provecho a estas nuevas
características deberían descargar y migrar sus aplicaciones a
PostgreSQL 9.0 beta ahora. Debido a que la versión 9.0 incluye algunas
nuevas características importantes asi como código interno revisado,
asi como cambios a la sintaxis permitida por el lenguaje PL/PgSQL, se
espera que existan problemas de compatibilidad con versiones
anteriores.

El código fuente, asi como instaladores binarios para alagunas
plataformas, están disponibles en el sitio web de PostgreSQL:

* Página de información del Beta: http://www.postgresql.org/developer/beta
* Código fuente: http://www.postgresql.org/ftp/source/9.0beta1
* Instalador para Windows: http://www.enterprisedb.com/products/pgdownload.do
* Binarios para otras plataformas:
http://www.postgresql.org/ftp/binary/9.0beta1
* Notas de versión:
http://developer.postgresql.org/pgdocs/postgres/release-9-0.html

Social links powered by Ecreative Internet Marketing