PostArabic adds Arabic shaping and unshaping to PostgreSQL.

(Un)shaping of Arabic characters is required for certain low-level graphics
output, e.g. PDF rendering or GIS map display using mapserver.

The functions work on UNICODE characters.

PostArabic was developed as part of the DCMMS project. Additional information on PostArabic is available on the DCMMS website, especially in the DCMMS Development Guide and Administration Guide:

The availability of Arabic shaping support in mapserver largely eliminates the need for PostArabic. Thus PostArabic 1.0.6 is most probably the last PostArabic release.


PostArabic is compatible with PostgreSQL 8.1 and above.

For Windows PostgreSQL users, a Windows installer executable is provided on

To install the module, move this directory to the "contrib" directory of your PostgreSQL source installation. Alternately, edit the "top_buildir" in the Makefile and point it at your PostgreSQL source tree. You must have a PostgreSQL source tree, and you must have run succesfully built and installed it for this to work.

As root run:

make make install

PostArabic requires the PL/pgSQL procedural language in order to operate correctly. To install PL/pgSQL use the 'createlang' program from the PostgreSQL installation. (The PostgreSQL Programmer's Guide has details if you want to this manually for some reason.) The database encoding should be UNICODE.

As postgres run:

createlang plpgsql yourdatabase psql -f libarabic.sql -d yourdatabase

Installation should now be complete.


The package adds the following functions to PostgreSQL:

* text shape_arabic(text) * text unshape_arabic(text) * text str_reverse(text) * text bidi_reorder(text) * text utf8dump(text) * text postarabic_version()

Try the following example SQL statements to use PostArabic:

update Landmark set ArLocation=shape_arabic(ArLocation); select utf8dump('test'); select unshape_arabic(ArLocation); select str_reverse('test'); select bidi_reorder('somearabictext');


To create the Windows installer, use NSIS:

To create an OpenSuSE RPM:

Copy postarabic.spec to /usr/src/packages/SPECS Copy postarabic-1.*.* to /usr/src/packages/SOURCES Run rpmbuild -ba /usr/src/packages/SPECS/postarabic.spec