midgardproject/midgard-core — Issue #130: PostgreSQL broken
Author: bergie
Created: 2011-12-15 14:46:27+00:00
State: open

Currently the PostgreSQL implementation in Midgard2 is broken. To my understanding the problem comes from the fact that postgres has a boolean type, and Midgard2 uses `1` and `TRUE` interchangeably because the other databases don't care.

From phpcr-midgard2 API tests [on Travis](http://travis-ci.org/#!/bergie/phpcr-midgard2/jobs/409304):

$ phpunit -c api-test/phpunit_${DATABASE}.xml.dist
Disabling Zend Garbage Collection to prevent segfaults, see:
https://bugs.php.net/bug.php?id=51091
https://github.com/midgardproject/midgard-php5/issues/50
PHPUnit 3.6.4 by Sebastian Bergmann.

Configuration read from /home/vagrant/builds/bergie/phpcr-midgard2/api-test/phpunit_postgresql.xml.dist

midgard-core (pid:10313):(WARNING):Midgard connection error: column "active" is of type boolean but expression is of type integer
LINE 1: ...15c11e64583ae10ae10', 'f6b665f1984503790ed91f39b11b5392', 1)
^
HINT: You will need to rewrite or cast the expression., No:(-1), src:gda-postgres, SQL: 42804
midgard-core (pid:10313):(WARNING):Midgard connection error: column "active" is of type boolean but expression is of type integer
LINE 1: ...15c11e64583ae10ae10', 'f6b665f1984503790ed91f39b11b5392', 1)
^
HINT: You will need to rewrite or cast the expression., No:(-1), src:gda-postgres, SQL: 42804
midgard-core (pid:10313):(WARNING):Midgard connection error: invalid input syntax for integer: "FALSE", No:(-1), src:gda-postgres, SQL: HY000
midgard-core (pid:10313):(WARNING):Query failed. invalid input syntax for integer: "FALSE"
midgard-core (pid:10313):(CRITICAL ):Newly created midgard_person object's id is 0! ( object's guid - f6b665f1984503790ed91f39b11b5392 )
EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE 63 / 656 ( 9%)