pgchess
A Chess extension
pgchess · A Chess extension
Overview
Usage
Sources:
- Official upstream README
- Official extension control file (pgchess.control)
- Official extension SQL (pgchess.sql)
pgchess — pgchess is a PostgreSQL 9.1+ extension for the game of Chess. Use it when an application needs this specific database capability. Use the pinned upstream revision linked above as the API boundary and test it on the target PostgreSQL build.
Core Workflow
Install the extension in the intended database, run the smallest upstream example above when available, and verify the installed version and returned values before integrating it into application SQL.
Important Objects
c_score(IN b game)is an extension function and returnsdouble.chess_letter_to_x(char)is an extension function and returnsint2.chess_x_to_letter(int2)is an extension function and returnstext.int_to_int_to_location(IN x int , IN y int)is an extension function and returnslocation.is_game_ended(IN b game)is an extension function and returnsboolean.is_king_safe(IN b game)is an extension function and returnsboolean.location_to_location_to_move(IN a location , IN b location)is an extension function and returnsmove.piece_display_ascii(character(1))is an extension function and returnstext.piece_display_utf8(character(1))is an extension function and returnstext.piece_value(character(1))is an extension function and returnsdouble.valid_moves(IN b game)is an extension function and returnsSETOF move.gameis an extension-defined type.locationis an extension-defined type.moveis an extension-defined type.
Requirements and Caveats
- The reviewed control file declares default version
0.1.7. - The control file marks the extension as relocatable.
- Confirm privileges, supported PostgreSQL versions, upgrade behavior, and failure cases against the pinned source before production use.