# PostgreSQL 9.1

**URL:** <https://forum.inductiveautomation.com/t/postgresql-9-1/4262>\
**Category:** Archived Topics\
**Created:** [April 7, 2012, 6:30pm UTC](https://forum.inductiveautomation.com/t/postgresql-9-1/4262 "2012-04-07T18:30:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [April 7, 2012, 6:30pm UTC](https://forum.inductiveautomation.com/t/postgresql-9-1/4262/1 "2012-04-07T18:30:47Z")

</div>

Doing some testing with latest and greatest PostgreSQL… Immediately ran into a data type issue with boolean columns. Appears Postgres no longer automatically casts integer zeros and ones into booleans when inserting into or updating boolean columns.

The designer choked on the problem with a fairly cryptic RPC error, but as I was testing a new database, I looked at the query log first and saw:

column “deleted” is of type boolean but expression is of type integer  
You will need to rewrite or cast the expression.

A google search brought me to [archives.postgresql.org/pgsql-ge … g01056.php](http://archives.postgresql.org/pgsql-general/2007-12/msg01056.php), which shows how to re-establish the auto-cast.

Specifically, as a privileged database user, execute:

update pg\_cast set castcontext = ‘a’ where castsource = ‘int’::regtype and casttarget = ‘bool’::regtype;

Hope this helps someone.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [April 7, 2012, 7:52pm UTC](https://forum.inductiveautomation.com/t/postgresql-9-1/4262/2 "2012-04-07T19:52:45Z")

</div>

Hmmm. This fix doesn’t survive DB restart.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [April 7, 2012, 9:31pm UTC](https://forum.inductiveautomation.com/t/postgresql-9-1/4262/3 "2012-04-07T21:31:43Z")

</div>

I downgraded the PostgreSQL JDBC driver from postgresql-9.1-901.jdbc4.jar to postgresql-9.1-901.jdbc3.jar.

Problem seems to be gone.

FWIW, this is on Gentoo Linux 64bit w/ Ignition 7.4.1 & Sun JDK 1.6.0.31
