SoC postgres support

From GeeklogWiki
Jump to: navigation, search

This is one of the projects to be implemented during the Google Summer of Code 2009.

Student: Stan Palatnik, Mentor: Vincent Furia
Project repository


Project info and advancement during Summer of Code

(to be written)

Pre-Summer of Code idea discussion & preparation


Geeklog currently supports MySQL and MS SQL Server for the database. Recently, we have had an increasing amount of requests to add support for PostgreSQL (aka Postgres).


Development of Geeklog started back in 2000 when most of today's database abstraction layers didn't even exist yet. It therefore uses its own (thin) abstraction layer and will have to continue to do so for the foreseeable future.

The idea is simple: Create a database abstraction layer for PostgreSQL for Geeklog. In theory, that would "only" require the implementation of one class in one file: system/databases/postgres.class.php (alongside mysql.class.php and mssql.class.php).

Due to Geeklog's thin database abstraction layer, some non-standard SQL has crept into the codebase here and there. The MS SQL implementation works around this by patching some of those requests at runtime. While our goal is to use standard-compliant SQL as much as possible it may not always be possible to change this for reasons of backward compatibility. Also, not all the code is under our control, e.g. in plugins.

In addition to the actual database class, there are also database-specific files to initialize and upgrade the database and the plugins. They usually include the SQL requests to be executed as well as, in case of upgrade files, some PHP code. Equivalents of these files for Postgres will also have to be implemented (obviously, we would not need upgrade files for older Geeklog versions).

Level of Difficulty

medium to high

Students interested in this project should be very familiar with Postgres to be able to work around the restrictions outlined above.

Further Reading

Personal tools