PostgreSQL

PostgreSQL is a free alternative to commercial DBMS (such as Oracle, MsSQL Server, IBM DB2, Informix and DBMS manufactured by Sybase), like other free DBMS (such as MySQL and Firebird).

PostgreSQL is based on the SQL language and supports many of the capabilities of the SQL:2003 standard (ISO/IEC 9075).

At this moment in time, PostgreSQL (version 8.4.0) has the following limitations:

A maximum database size no limitations
A maximum table size 32 Tb
A maximum entry size 1,6 Tb
A maximum field size 1 Gb
A maximum number of entries in a table no limitations
A maximum number of fields in a table 250—1600, relating to field types
A maximum number of indexes in a table no limitations

The strong points of PostgreSQL are considered to be:

  • support for databases of practically unlimited size;
  • powerful and reliable transaction and replication mechanisms;
  • inheritance;
  • simple expandability.

Configuring PostgreSQL

Installation of PostgreSQL is relatively straightforward – simply download the distribution kit from the official website: http://www.postgresql.org/download/windows/ and launch the installation process. During the installation process, you will be required to enter the password of the database administrator (the user with login postgres).

In cases where the database will be accessed from a deleted machine, you will need to enable the deleted connections in the DBMS settings.

Step-by-step instructions are presented below:

  • you will need to edit the file C:\Program Files\PostgreSQL\8.3\data\postgresql.conf, as shown in Figure 1, specifying as the value for the listen_addresses parameter the IP address from which the DBMS will listen and expect an incoming connection (By default, * is entered, meaning All addresses. You may leave this value and not change anything if you wish).

    Figure 1.

    Once you have edited the postgresql.conf file, save it under the same name.

  • You will need to configure access permission from specific deleted computers. For this, you will need to open the file C:\Program Files\PGSQL\8.3\data\pg_hba.conf in any text editor and find in it the following line:

    # Ipv4 local connections:

    In the list located below this line, add an entry corresponding with the range of IP addresses of the computers from which connections will be initialized. For example:

    host all all 192.168.0.7/32 md5

    where,

    host – signifies authorization at host level

    all – signifies that access will be enabled to all databases for all users

    192.168.0.7/32 – range of IP addresses, from which a connection will be made (in the format IP/Mask)

    md5 – defines the type of encryption for the information being transmitted

    An example of the contents of file pg_hba.conf is shown in Figure 2.

    Figure 2.
  • Once you have edited and saved files postgresql.conf and pg_hba.conf you will need to restart the database server. To do this, simply restart the PostgreSQL Server service. Changes will be applied only once PostgreSQL is restarted.

The next step is creating the database.

To create a database, launch the PostgreSQL console (script C:\Program Files\PostgreSQL\8.3\scripts\runpsql.bat) and run the following command:

CREATE DATABASE "Activity" WITH OWNER = postgres ENCODING = 'UTF8';

where,

Activity - name of database being created

postgres - name of database manager

utf8 – text encoding used to store data in the database.

The result of the executed command is shown in Figure 3.

Figure 3.

Data Center Configuration

Once the new database is created, Data Center should be set up in order to work with it. For this, you must open the program’s management console, go to the Configuration page shown in Figure 4, and select Data Storage Settings.

Figure 4.

In the dialog that opens, select a database type (in our case, PostgreSQL).

Figure 5.

On the second tab, enter the connection parameters as shown in Figure 6,

where,

192.168.0.166 - IP address of PostgreSQL

5432 - port through which the connection will be made (5432 used by default)

User name - name of user with privileges to connect to the database (all necessary privileges assigned to user postgres earlier)

Password - password for user postgres, chosen on installation of PostgreSQL

Figure 6.

To test whether the connection parameters have been entered correctly, click Test Connection.

After you press Test Connection, the program will attempt to connect to the database, and if the connection settings were specified correctly, the message shown in Figure 7 will appear.

Figure 7.

Next, click OK.

A message will appear notifying you that Data Center must be restarted for the new parameters to be applied (Figure 8).

Figure 8.

Click Yes, and Data Center will restart automatically. Once Data Center is restarted, all changes will take effect and the program will begin using the new database to store information.

To test the efficiency of the new database, simply print any document so that it prints to the database (on a virtual printer, or from a computer with an agent working in Client Side Monitoring mode installed). If the actions described above have been carried out correctly, the program will allow you to format a report displaying information about the printed text document.

The status of the database can be viewed on the Statistics tab of the data storage management dialog (Figure 9).

Figure 9.

Conclusion:

PostgreSQL is a freely-distributed object-relational database management system (ORDBMS), the most developed open-source DBMS in the world, and is a real alternative to commercial databases.

PostgreSQL is considered the best for a number of reasons:

  • support for databases of practically unlimited size;
  • powerful and reliable transaction and replication mechanisms;
  • inheritance;
  • simple expandability.

Additional Links

Search

Authorization

 
Forgot your password?
Register

Subscribe

Subscribe to company news