It is currently Fri Aug 01, 2014 4:23 pm




Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
 PostgreSQL 9.1 
Author Message
Trooper
Trooper

Joined: Mon Dec 08, 2008 10:27 am
Posts: 15
Location: Atlanta, GA
Post PostgreSQL 9.1
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 http://archives.postgresql.org/pgsql-ge ... g01056.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.


Sat Apr 07, 2012 10:30 am
Profile
Trooper
Trooper

Joined: Mon Dec 08, 2008 10:27 am
Posts: 15
Location: Atlanta, GA
Post Re: PostgreSQL 9.1
Hmmm. This fix doesn't survive DB restart.


Sat Apr 07, 2012 11:52 am
Profile
Trooper
Trooper

Joined: Mon Dec 08, 2008 10:27 am
Posts: 15
Location: Atlanta, GA
Post Re: PostgreSQL 9.1  Topic is solved
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


Sat Apr 07, 2012 1:31 pm
Profile
Display posts from previous:  Sort by  
Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: