Menu

#44 Problem with PostgreSQL autoincrement sequence

v0.3.0
closed
SQL (14)
6
2014-08-22
2006-07-24
No

In easymod_install.php at line 937 :

    case 'postgresql':
        if\( $create\_easymod\_table \)
        \{
            $sql\[\] = "CREATE SEQUENCE " . EASYMOD\_TABLE .

"_mod_id_seq start 1 increment 1 maxvalue 2147483647
minvalue 1 cache 1";

            $sql\[\] = "CREATE TABLE " . EASYMOD\_TABLE . " \(
                mod\_id int4 NOT NULL DEFAULT nextval\('" .

EASYMOD_TABLE . "_mod_id_seq'::text),

I think there we must replace "_mod_id_seq" with
"_id_seq". Indeed, in phpBB2 file db/postgres7.php,
in function sql_nextid(), there is next SQL code :

"SELECT currval('" . $tablename[1] . "_id_seq') AS
last_value";

And so, for sql_nextid() to work, all sequences MUST
have next name :

tablename_id_seq, and not tablename_mod_id_seq !

I am developping a mod which works fine with MySQL
and after this small code correction it works fine
with Postgres to.

Am I right ? If yes, it would be nice to correct
it in next easymod version.

Regards

Discussion

  • Fabrice Jammes

    Fabrice Jammes - 2006-07-24
    • summary: Pb with PostgreSQL --> Problem with PostgreSQL
     
  • Fabrice Jammes

    Fabrice Jammes - 2006-07-24
    • priority: 5 --> 6
     
  • Gordon P. Hemsley

    • milestone: --> v0.3.0
    • assigned_to: nobody --> markus_petrux
    • summary: Problem with PostgreSQL --> Problem with PostgreSQL autoincrement sequence
     
  • Anonymous

    Anonymous - 2007-03-13

    Logged In: YES
    user_id=1242849
    Originator: NO

    You are correct, and this is not the only EasyMod problem w/ PostgreSQL; see report 1680118.

     
  • Jim Wigginton

    Jim Wigginton - 2008-02-16
    • status: open --> closed
     
  • Jim Wigginton

    Jim Wigginton - 2008-02-16

    Logged In: YES
    user_id=1265254
    Originator: NO

    This bug has been fixed in CVS and will appear in the next
    version of EasyMOD. Thank you for reporting it.

     

Log in to post a comment.

MongoDB Logo MongoDB