Using PGXN network

PGXN client itself is available at github and
can be installed with your favourite method, i.e. easy_install pgxnclient.

Using PGXS makefiles

C extension are best built and installed using PGXS.
PGXS ensures that make is performed with needed compiler and flags. You only need GNU make and a compiler to build
an extension on an almost any UNIX platform (Linux, Solaris, OS X).

Compilation:

gmake PG_CONFIG=<postgresql_install_dir>/bin/pg_config

Installation (as superuser):

gmake PG_CONFIG=<postgresql_install_dir>/bin/pg_config install

PostgreSQL server must be restarted.

To uninstall extension completely you may use this command (as superuser):

gmake PG_CONFIG=<postgresql_install_dir>/bin/pg_config uninstall

Project contains SQL tests that can be launched on PostgreSQL with installed extension.
Tests are performed on a dynamically created database with a specified user (with the
appropriated permissions - create database, for example):

Manually

Use this method if you have a precompiled extension and do not want to install this with help of PGXS.
Or maybe you just do not have GNU make on a production server.
Or if you use Windows (use MSVC 2008 for Postgres 9.1 and MSVC 2010 for Postgres 9.2).

Creating extension in a database

Extension must be previously installed to a PostgreSQL directory.

Extension is created in a particular database (as superuser):

create extension json_accessors;

It creates all the functions, operators and other stuff from extension.
Note that you must restart a server if a previous library was already installed
at the same place. In other words, always restart to be sure.