#550 Fix for running 4.2.2 on Fedora 12 with PostgreSQL

Normal Version
closed-accepted
nobody
None
5
2009-12-24
2009-12-11
Utopiabound
No

Postgres 8.4.2 is entirely unusable after upgrading from 4.2.1. The PDO layer just throws errors, after searching around the web I found what needed to be changed for it work. I've made these changes on my system and it's now functional.

There were two errors fixed:
* Prepare statements can't do correct type checking and fail. (see below)
* "PDO::ATTR_AUTOCOMMIT=>true" on connect throws an error.

Prepare Errors where like this:
PHP Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42P18]: Indeterminate datatype: 7 ERROR: could not determine data type of parameter $1' in /var/www/family/includes/classes/class_pgv_db.php:837\nStack trace:
#0 [internal function]: PDOStatement->execute(Array)\n#1 /var/www/family/includes/classes/class_pgv_db.php(837): call_user_func_array(Array, Array)
#2 [internal function]: PGV_DBStatement->__call('execute', Array)
#3 /var/www/family/includes/functions/functions_db.php(865): PGV_DBStatement->execute(Array)
#4 /var/www/family/includes/classes/class_person.php(104): fetch_person_record('', 1)
#5 /var/www/family/includes/classes/class_menubar.php(376): Person::getInstance('')
#6 /var/www/family/themes/standard/toplinks.php(51): MenuBar::getChartsMenu()
#7 /var/www/family/themes/standard/header.php(155): include('/var/www/family...')
#8 /var/www/family/includes/functions/functions_print.php(598): include('/var/www/family...')
#9 /var/www/family/login.php(154): print_header('PhpGedView User...')
#10 {mai in /var/www/family/includes/classes/class_pgv_db.php on line 837

Discussion

1 2 > >> (Page 1 of 2)
  • Utopiabound
    Utopiabound
    2009-12-11

    Patch to includes/classes/class_pgv_db.php of pgsql errors

     
  • Greg Roach
    Greg Roach
    2009-12-11

    Hi - I'm the phpGedView developer who wrote and maintains the DB code.

    I would really love to fix this problem. However, I'm having real difficulties installing postgresql on my own computer. If you know of any sources of support that might help, please let me know.

    I run the postgresplus-8.4.1-2-windows.exe installer on vista-home-premium. The installation runs without error, but when I try to start the server, I get the message

    "The service name is invalid. More help is available by typing NET HELPMSG 2185. The start command returned an error (2)"

    I would be most grateful for any suggestions.

    Greg

     
  • Utopiabound
    Utopiabound
    2009-12-22

    Re: fisharebest

    http://www.enterprisedb.com/learning/tutorials.do

    "How to get Started .. with Windows"
    Step 3: "If you are using Windows Vista with User Account Control, do not click on Start Server, yet"
    Step 4 (For Vista with User Account Control): "Click the right mouse button on Start Server. On the Start Server submenu, click the left mouse button on Run as Administrator, and then click Continue in the User Account Control pop-up window. The Start Server window appears.

     
  • Greg Roach
    Greg Roach
    2009-12-22

    Utopiabound - thanks for this! I now have a functioning PG database, and am working through the compatibility issues.

     
  • Greg Roach
    Greg Roach
    2009-12-23

    I've submitted some changes to SVN that allow me to set up and run PGV using postgres. I've only had a quick test of the major features, but it seems to be OK.

    The patch sets the PGSQL_ATTR_DISABLE_NATIVE_PREPARED_STATEMENT attribute on connection. This didn't appear to be necessary, and so I haven't included it. What is the reason for this (particular versions of PG perhaps?)

    Some of the statistics queries use nested subqueries in a way that PG doesn't like. I'll look at these next.

     
  • Utopiabound
    Utopiabound
    2009-12-23

    fisharebest -

    I do think the PGSQL_ATTR_*STATEMENT on connection is unnecessary. I was hacking my live system to get it back up and running and I just ran a diff after I got it working.

    I don't use the stats page much so I hadn't noticed, but it does seem to be broken for some stats.

    Thank you so much for digging into this. I'd be happy to test if you need me to.

    For the record my setup is:
    OS: Fedora 12
    PostgreSQL: 8.4.2-1.fc12
    Apache: 2.2.14
    PHP: 5.3.1
    PDO_pgsql: 1.0.2

     
  • Greg Roach
    Greg Roach
    2009-12-23

    <<I'd be happy to test if you need me to.>>

    Please do.

    I intended to create the next release (4.2.3) a few days ago. I will delay this until the weekend, so allow time to address Postgres issues.

    If you can find any problems before then, I can include them in the release. Otherwise the next release will not be for many months.

     
  • Utopiabound
    Utopiabound
    2009-12-23

    I went through and created a whole new DB to test everything out.
    All the statistcs seem to work (and they look good too).

    "Place check" blows up: (SVN rev 6614)
    exception 'PDOException' with message 'SQLSTATE[42704]: Undefined object: 7 ERROR: type "pgv_pl_level" does not exist
    LINE 1: ...MARY KEY (pl_id ), INDEX pgv_pl_lev...
    ^' in /var/www/family-new/includes/classes/class_pgv_db.php:690
    Stack trace:
    #0 /var/www/family-new/includes/classes/class_pgv_db.php(690): PDO->exec('CREATE TABLE pg...')
    #1 /var/www/family-new/modules/googlemap/db_schema/db_schema_0_1.php(61): PGV_DB::exec('CREATE TABLE pg...')
    #2 /var/www/family-new/includes/classes/class_pgv_db.php(777): require('/var/www/family...')
    #3 /var/www/family-new/modules/googlemap/placecheck.php(53): PGV_DB::updateSchema('modules/googlem...', 'GM_SCHEMA_VERSI...', 1)
    #4 /var/www/family-new/module.php(72): require_once('/var/www/family...')
    #5 {main}

     
  • Greg Roach
    Greg Roach
    2009-12-23

    This should now be fixed in SVN.

     
  • Utopiabound
    Utopiabound
    2009-12-24

    That looks good!

     
1 2 > >> (Page 1 of 2)