Faustas - Programming, Projects, Psychology and Faust
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.
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
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:
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:
I needed a way to search for specific tables in Postgres. The following stored procedure searches for tables that match the given regular expression.