software that plays chess written only on top of PostgreSQL
C Shell
Switch branches/tags
Nothing to show
Failed to load latest commit information.
doc An .o file was included in the PGXN .zip archive for version 0.1.6 Nov 20, 2012
scripts Cleanup Nov 6, 2012
sql Implemented halfmove counter and the 50 halfmove rule. Oct 26, 2012
src Fixed 9.3 warning Nov 6, 2012
test/sql Regression expected output changed to match pg2podg 0.1.3 Nov 6, 2012
AUTHORS tidied up Dec 6, 2010
COPYING tidied up Dec 6, 2010
ChangeLog An .o file was included in the PGXN .zip archive for version 0.1.6 Nov 20, 2012
META.json Forgot META.json in version 0.1.7 Nov 21, 2012
Makefile Cleanup Nov 6, 2012
pgchess.control An .o file was included in the PGXN .zip archive for version 0.1.6 Nov 20, 2012

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.