Opened 4 years ago

Closed 4 years ago

#50 closed defect (fixed)

Better support for PostgreSQL Boolean types

Reported by: cito Owned by:
Priority: major Milestone: 5.1
Component: DB API 2 Version: 4.1
Keywords: Cc:

Description (last modified by cito)

Currently, Pygres can map Postgres Boolean values only to strings ('t', 'f') in Python.

We should support automatic convertion to and from the Python boolean type (True, False) on both input and output, in pg as well as in pgdb.

This could be made configurable with a switch that would be set to off by default in 5.x, and then in 6.x the switch could be flipped.

Change History (2)

comment:1 Changed 4 years ago by cito

  • Description modified (diff)

comment:2 Changed 4 years ago by cito

  • Resolution set to fixed
  • Status changed from new to closed

pgdb already fully supports Boolean values and I have added a test for this in r630.

pg already supported Boolean as parameters, so we only needed to support conversion to bool on output, which I have done in r634.

So this ticket is done!

Note however, that this is not enabled by default because we want to stay backward compatible. To activate it, you need to activate bool support by calling pg.set_bool(True). The default setting for this can be changed in 5.x or 6.x.

Note: See TracTickets for help on using tickets.