1.3.12 -> 1.3.14 upgrade with postgres

Help
2009-01-16
2012-10-11
  • Olivier Meunier

    Olivier Meunier - 2009-01-16

    The upgrade script psql-1.3.12.sql contains:
    ALTER TABLE plugin_wiki_page
    ALTER COLUMN id TYPE SERIAL / PRIMARY KEY /,
    that generates the error:
    ERROR: type "serial" does not exist

    Should be replaced by:

    CREATE SEQUENCE plugin_wiki_page_id_seq
    INCREMENT 1 MINVALUE 1 MAXVALUE 2147483648 START 1 CACHE 1;
    SELECT setval('plugin_wiki_page_id_seq',max(id)) FROM plugin_wiki_page;
    ALTER TABLE plugin_wiki_page ALTER COLUMN id
    SET DEFAULT nextval('plugin_wiki_page_id_seq'::regclass);
    ALTER TABLE plugin_wiki_page ADD PRIMARY KEY (id);

    Any comment ?

     
    • Olivier Meunier

      Olivier Meunier - 2009-01-21

      This has nothing to do with the version of postgresql (I have 8.3). The syntax is ok in a CREATE TABLE syntax, but not in a ALTER TABLE one. Serial is not a real data type. This fix is only for the upgrade script.

       
    • Reini Urban

      Reini Urban - 2009-01-16

      Thanks.
      It's probably better to use this backwards compatible SQL

      But I recommend to use newer postgresql versions, like 8.2 or 8.3, esp. for fulltext search.

       

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks