Skip to content


Subversion checkout URL

You can clone with
Download ZIP
software that plays chess written only on top of PostgreSQL
C Shell
Failed to load latest commit information.
doc An .o file was included in the PGXN .zip archive for version 0.1.6
scripts Cleanup
sql Implemented halfmove counter and the 50 halfmove rule.
test/sql Regression expected output changed to match pg2podg 0.1.3
AUTHORS tidied up
COPYING tidied up
ChangeLog An .o file was included in the PGXN .zip archive for version 0.1.6
META.json Forgot META.json in version 0.1.7
Makefile An .o file was included in the PGXN .zip archive for version 0.1.6

pgchess 0.1.7

pgchess is a PostgreSQL 9.1+ extension for the game of Chess.


To build pgchess, just type:

make installcheck
make install

If you encounter an error such as:

"Makefile", line 8: Need an operator

you need to use GNU make, which may well be installed on your system as gmake:

gmake install
gmake installcheck

If you encounter an error such as:

make: pg_config: Command not found

be sure that you have pg_config installed and in your path. If you used a package management system such as RPM to install PostgreSQL, be sure that the -devel package is also installed. If necessary tell the build process where to find it:

env PG_CONFIG=/path/to/pg_config make && make installcheck && make install


Once pgchess is installed, you can add it to a database. You must be running PostgreSQL 9.1 or greater, so it's a simple as connecting to a database as a super user and running:



Strictly speaking, extension pgchess has no dependencies other than PostgreSQL and PL/pgSQL.

However, some generic functionalities have been placed in a separate extension pg2podg, so that they can be reused by extensions implementing other two-player open deterministic games such as Naughts-and-Crosses, Nim, etc.

Extension pg2podg is therefore recommended, as well as required for some of pgchess functionalities, including the capability to run regression tests and to play a game of Chess.

Both pgchess and pg2podg are available via the PostgreSQL Extension Network.

Upgrades from previous versions

Currently the only way to upgrade from a previous version of pgchess is to drop the extension, uninstall the old version, install the new version and finally (re)create the extension.

In particular, any extensions that depend on pgchess or on some of its objects need to be dropped and recreated.

Please notice that the pgchess extension so far contains only types, functions and operators.

Copyright and Licence

Copyright (c) 2010, 2011, 2012 Gianni Ciolli.

This module is free software; you can redistribute it and/or modify it under the GNU General Public License version 3 or later.

Something went wrong with that request. Please try again.