Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.2.3

Bug #768 query update failure(postgresql)
Submitted: 2004-02-16 08:22 UTC
From: shota at dino dot co dot jp Assigned: quipo
Status: Closed Package: MDB_QueryTool
PHP Version: 4.2.2 OS: Redhat9
Roadmaps: (Not assigned)    
Subscription  


 [2004-02-16 08:22 UTC] shota at dino dot co dot jp
Description: ------------ sql update failure when i use postgresql. when i execute pear/docs/MDB_QueryTool/docs/example.php using postgresql, i can't clear all examples. in $MDB->_buildselect(), MDB attaches 'tablename.' before fieldname. so query is failed. when i try below query without 'uuser.', query is ok. </pre><h1>10 - adding data using $user->save($data)</h1><pre>6</pre><h1>11 - updating using $user->save($data)</h1><pre>user::MDB Error: syntax error-UPDATE uuser SET uuser.id='6',uuser.login='NEW',uuser.name='Mr. foo' WHERE id='6' [nativecode = ERROR: parser: parse error at or near "." at character 23 ] (unknown)</pre><pre>user::UPDATE uuser SET uuser.id='6',uuser.login='NEW',uuser.name='Mr. foo' WHERE id='6' [nativecode = ERROR: parser: parse error at or near "." at character 23 ] (1752)</pre><pre></pre><h1>12 - updating using $user->update($data)</h1><pre>user::MDB Error: syntax error-UPDATE uuser SET uuser.id='6',uuser.login='NEW',uuser.name='Mr. foo' WHERE id='6' [nativecode = ERROR: parser: parse error at or near "." at character 23 ] (unknown)</pre><pre>user::UPDATE uuser SET uuser.id='6',uuser.login='NEW',uuser.name='Mr. foo' WHERE id='6' [nativecode = ERROR: parser: parse error at or near "." at character 23 ] (1752)</pre><pre></pre><h1>13 - remove the entry $user->remove(6)</h1><pre>1</pre>

Comments

 [2004-02-18 10:32 UTC] quipo
The dot is a SQL standard for table/column name separator. I don't think that's the problem. Can you check if the table name is the right one, and if this query is OK? ---- UPDATE uuser SET uuser.id=6,uuser.login='NEW',uuser.name='Mr. foo' WHERE id=6 ---- IIRC, quotes around numeric values are not allowed in postgres.
 [2004-02-20 11:06 UTC] quipo
Please provide some feedback. It will help me fixing the bug asap. Thanks for your help.
 [2004-02-23 03:49 UTC] shota at dino dot co dot jp
this is table i used for testing. query=# SELECT * from uuser; id | login | name | surname | email | isadmin | password ----+-------+---------+----------+---------------+---------+---------------------------------- 4 | pp | Paolo | Panto | pp@visionp.de | 1 | 3 | cain | Wolfram | Kriesing | wk@visionp.de | 1 | 8a9d62c756bd894451e63e9a511ded0c (2 rows) the result using MDB_QueryTool is query=# UPDATE uuser SET uuser.id='6',uuser.login='NEW',uuser.name='Mr. foo' WHERE id='6'; ERROR: parser: parse error at or near "." at character 23 remove uuser., query=# UPDATE uuser SET id='6',login='NEW',name='Mr. foo' WHERE id='6'; UPDATE 0
 [2004-03-13 19:06 UTC] quipo
This bug has been fixed in CVS. In case this was a documentation problem, the fix will show up at the end of next Sunday (CET) on pear.php.net. In case this was a pear.php.net website problem, the change will show up on the website in short time. Thank you for the report, and for helping us make PEAR better.