postgres

Install OpenCRX with PostgreSQL and Ubuntu 10.04

If you want to install OpenCRX 2.8.5 with a Postgres database, you have to do some additional steps during the installation. The general installation steps are described at OpenCRX 2.8.5 Install. Here comes the short description with the additional changes for the Postgres database.

Convert timestamp to integer and integer to timestamp in Postgres

If you want to convert an integer value into a timestamp in Postgres, you can use the following function:

SELECT to_timestamp(1321398000);

The vice versa conversion can be done with the following line:

select extract(epoch from '2011-11-15 00:00:00+01'::timestamp with time zone)::integer

Use Stored Procedures in your Postgres database

If you want to use Stored Procedures within your Postgres system, you have to create a procedural language in the selected database. A simple solution could be to open pgadmin3 and connect to the desired database. Open a new Query window and type the following line:

CREATE LANGUAGE plpgsql;

A basic function template could be as follows:

Connect Drupal 6 with Postgres

I started a new project and wanted to use Postgres as database for my Drupal installation. The following steps explain the connection of a Drupal system with a Postgres database on an Ubuntu working machine.

First, you have to install the required packages on the command line:

Use a stored procedure to list the available tables of a Postgres schema

I needed a way to search for specific tables in Postgres. The following stored procedure searches for tables that match the given regular expression.

Syndicate content