Hi,
I just commited the following fix:
ralf@boulder:~/egroupware/phpgwapi/inc/adodb/drivers> svn diff
–diff-cmd diff -x -ub
Index: adodb-postgres64.inc.php
— adodb-postgres64.inc.php (Revision 25494)
+++ adodb-postgres64.inc.php (Arbeitskopie)
@@ -152,11 +152,17 @@
Using a OID as a unique identifier is not generally wise.
Unless you are very careful, you might end up with a tuple having
a different OID if a database must be reloaded. */
-
function _insertid($table,$column,$try_oid=true)
-
{
-
if ($try_oid)
{
if (!is_resource($this->_resultid) ||
get_resource_type($this->_resultid) !== ‘pgsql result’) return false;
$oid = pg_getlastoid($this->_resultid);
table might not use oid’s, default for 8.1+
{
// try the standard sequence name first, due to
table renames etc. this might not be the correct one
Index: adodb-postgres7.inc.php
— adodb-postgres7.inc.php (Revision 25494)
+++ adodb-postgres7.inc.php (Arbeitskopie)
@@ -121,6 +121,19 @@
} else return true;
}
-
// use pg_escape_string if available
-
function qstr($s,$magic_quotes=false)
-
{
-
if (!$magic_quotes && function_exists('pg_escape_string')) {
-
return "'".pg_escape_string($s)."'";
-
}
-
return parent::qstr($s,$magic_quotes);
-
}
-
-
function _insertid($table,$column)
-
{
-
return parent::_insertid($table,$column,false); // dont
try oid
/*--------------------------------------------------------------------------------------
You can get the files (should work in 1.4 as well) from:
http://svn.egroupware.org/egroupware/trunk/phpgwapi/inc/addodb/drivers/adodb-postgres64.inc.php
http://svn.egroupware.org/egroupware/trunk/phpgwapi/inc/addodb/drivers/adodb-postgres7.inc.php
It still uses oids for old postgres, but no longer for the new ones.
pg_insert_id() only works, if the tables has never been renamed, which
is not necessary the case.
Let me know if the files work for you, then I will commit them to the
1.4 branch too.
Ralf
vchekan schrieb:
Hello all,
I’ve fixed Postgresql backend and attached a patch to
http://www.egroupware.org/egroupware/index.php?menuaction=tracker.uitracker.edit&tr_id=1160
Could somebody take a look please? Its pity that PostgreSQL is broken for so
long time.
Cheers
Vadim.
–
Ralf Becker
eGroupWare Training & Support ==> http://www.egroupware-support.de
Outdoor Unlimited Training GmbH [www.outdoor-training.de]
Handelsregister HRB Kaiserslautern 3587
Geschäftsführer Birgit und Ralf Becker
Leibnizstr. 17, 67663 Kaiserslautern, Germany
Telefon +49 (0)631 31657-0
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft® Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
eGroupWare-developers mailing list
eGroupWare-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/egroupware-developers