Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when create contactgroup (PostgreSQL) #54

Open
ghost opened this issue Nov 21, 2012 · 0 comments
Open

Error when create contactgroup (PostgreSQL) #54

ghost opened this issue Nov 21, 2012 · 0 comments
Milestone

Comments

@ghost
Copy link

ghost commented Nov 21, 2012

MDB2 Error: unknown error (-1): _doQuery: [Error message: Could not execute statement]\n[Last executed query: SELECT currval('contactgroups')]\n[Native message: ERROR:  "contactgroups" is not a sequence]\n, referer: https://www.example.net/webmail/?_task=addressbook
--- pgsql.php   2012-11-21 12:27:47.879167352 +0400
+++ pgsql.fixed.php 2012-11-21 12:59:24.342982191 +0400
@@ -1122,10 +1122,11 @@
      */
     function lastInsertID($table = null, $field = null)
     {
-        if (empty($table) && empty($field)) {
+        if (empty($table)) {
             return $this->queryOne('SELECT lastval()', 'integer');
         }
-        $seq = $table.(empty($field) ? '' : '_'.$field);
+        // Sequence defined in postgres.initial.sql at line 124
+        $seq = $table.'_ids';
         $sequence_name = $this->quoteIdentifier($this->getSequenceName($seq), true);
         return $this->queryOne("SELECT currval('$sequence_name')", 'integer');
     }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants