Index: head/databases/pear-Horde_Db/Makefile =================================================================== --- head/databases/pear-Horde_Db/Makefile (revision 528439) +++ head/databases/pear-Horde_Db/Makefile (revision 528440) @@ -1,25 +1,26 @@ # $FreeBSD$ PORTNAME= Horde_Db PORTVERSION= 2.4.0 +PORTREVISION= 1 CATEGORIES= databases www pear MAINTAINER= horde@FreeBSD.org COMMENT= Horde Database Libraries OPTIONS_DEFAULT= MYSQLI OPTIONS_DEFINE= MYSQLI PDO MYSQLI_DESC= Depend on mysqli PHP extension PDO_DESC= Depend on PDO PHP extension USES= horde USE_HORDE_RUN= Horde_Date \ Horde_Exception \ Horde_Support MYSQLI_USES= php MYSQLI_USE= PHP=mysqli PDO_USES= php PDO_USE= PHP=pdo .include Index: head/databases/pear-Horde_Db/files/patch-lib_Horde_Db_Adapter_Postgresql_Schema.php =================================================================== --- head/databases/pear-Horde_Db/files/patch-lib_Horde_Db_Adapter_Postgresql_Schema.php (nonexistent) +++ head/databases/pear-Horde_Db/files/patch-lib_Horde_Db_Adapter_Postgresql_Schema.php (revision 528440) @@ -0,0 +1,82 @@ +--- lib/Horde/Db/Adapter/Postgresql/Schema.php.orig 2017-02-27 10:00:17 UTC ++++ lib/Horde/Db/Adapter/Postgresql/Schema.php +@@ -3,12 +3,15 @@ + * Copyright 2007 Maintainable Software, LLC + * Copyright 2008-2017 Horde LLC (http://www.horde.org/) + * ++ * See the enclosed file LICENSE for license information (BSD). If you ++ * did not receive this file, see http://www.horde.org/licenses/bsd. ++ * + * @author Mike Naberezny + * @author Derek DeVries + * @author Chuck Hagenbuch + * @author Jan Schneider +- * @license http://www.horde.org/licenses/bsd + * @category Horde ++ * @license http://www.horde.org/licenses/bsd + * @package Db + * @subpackage Adapter + */ +@@ -21,8 +24,10 @@ + * @author Derek DeVries + * @author Chuck Hagenbuch + * @author Jan Schneider +- * @license http://www.horde.org/licenses/bsd + * @category Horde ++ * @copyright 2007 Maintainable Software, LLC ++ * @copyright 2008-2017 Horde LLC ++ * @license http://www.horde.org/licenses/bsd + * @package Db + * @subpackage Adapter + */ +@@ -1057,13 +1062,32 @@ class Horde_Db_Adapter_Postgresql_Schema extends Horde + $quotedSequence = $this->quoteSequenceName($sequence); + $quotedTable = $this->quoteTableName($table); + $quotedPk = $this->quoteColumnName($pk); +- +- $sql = sprintf('SELECT setval(%s, (SELECT COALESCE(MAX(%s) + (SELECT increment_by FROM %s), (SELECT min_value FROM %s)) FROM %s), false)', +- $quotedSequence, +- $quotedPk, +- $sequence, +- $sequence, +- $quotedTable); ++ if ($this->postgresqlVersion() >= 100000) { ++ $sql = sprintf(' ++ SELECT setval( ++ %s, ++ (SELECT COALESCE( ++ MAX(%s) + (SELECT increment_by FROM pg_sequences WHERE schemaname=ANY(CURRENT_SCHEMAS(false)) AND sequencename=%s), ++ (SELECT min_value FROM pg_sequences WHERE schemaname=ANY(CURRENT_SCHEMAS(false)) AND sequencename=%s) ++ ) FROM %s), ++ false ++ )', ++ $quotedSequence, ++ $quotedPk, ++ $quotedSequence, ++ $quotedSequence, ++ $quotedTable ++ ); ++ } else { ++ $sql = sprintf( ++ 'SELECT setval(%s, (SELECT COALESCE(MAX(%s) + (SELECT increment_by FROM %s), (SELECT min_value FROM %s)) FROM %s), false)', ++ $quotedSequence, ++ $quotedPk, ++ $sequence, ++ $sequence, ++ $quotedTable ++ ); ++ } + $this->selectValue($sql, 'Reset sequence'); + } else { + if ($this->_logger) { +@@ -1138,9 +1162,7 @@ class Horde_Db_Adapter_Postgresql_Schema extends Horde + { + if (!$this->_version) { + try { +- $version = $this->selectValue('SELECT version()'); +- if (preg_match('/PostgreSQL (\d+)\.(\d+)\.(\d+)/', $version, $matches)) +- $this->_version = ($matches[1] * 10000) + ($matches[2] * 100) + $matches[3]; ++ $this->_version = $this->selectValue('SHOW server_version_num'); + } catch (Exception $e) { + return 0; + } Property changes on: head/databases/pear-Horde_Db/files/patch-lib_Horde_Db_Adapter_Postgresql_Schema.php ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property