Menu

Cannot create a new project using postgres

Help
2004-04-06
2004-05-19
  • Thiago Miranda

    Thiago Miranda - 2004-04-06

    When i try to create a new project:

    DB Error: unknown error
    SELECT NEXTVAL('phpbt_project_seq') [nativecode=ERROR: relation "phpbt_project_seq" do not exist ]

    Sugestions?

    Thanks.

     
    • Benjamin Curtis

      Benjamin Curtis - 2004-04-12

      I don't know why, but for some reason the sequences aren't being created in postgres on demand.  I can recreate the problem using 7.4.2, but I don't have a fix at the moment other than manually creating the sequences that cause the errors.

       
      • Thiago Miranda

        Thiago Miranda - 2004-04-13

        Thanks, i created 3 sequences, project, component and version. There are more? Is really slow when i create projects after inserting the sequences.

         
        • Benjamin Curtis

          Benjamin Curtis - 2004-04-14

          Yes, there are more -- one for almost every table.  I'm currently looking into the feasibility of using serial fields instead.

           
    • Nobody/Anonymous

      I just installed phpbugtracker and had the same problem.
      Why don't you just add these lines to your pgsql.in?

      CREATE SEQUENCE phpbt_project_seq;
      CREATE SEQUENCE phpbt_version_seq;
      CREATE SEQUENCE phpbt_component_seq;

      I see you have other sequences in there, it seems you just forgot these.

       
    • Nobody/Anonymous

      > the sequences aren't being created in postgres on demand

      PostgreSQL doesn't "create sequences on demand", you do have to create them yourself.

      > I'm currently looking into the feasibility of using serial fields instead.

      PostgreSQL is not like MySQL.

      Add these to your pgsql.in:

      CREATE SEQUENCE phpbt_project_seq;
      CREATE SEQUENCE phpbt_version_seq;
      CREATE SEQUENCE phpbt_component_seq;

      You have CREATE SEQUENCE statements for other sequences in there, you just forgot these.

       
      • Benjamin Curtis

        Benjamin Curtis - 2004-05-19

        Indeed, postgres does not create them on demand, but the PEAR DB library is supposed to do so.

        I know PG is not MySQL, but serial fields would be a suitable replacement to sequences outside the table, no?

        And finally, the reason I didn't create all the sequences (there aren't just these three) is because of the sequence-creation feature of PEAR DB.  However, given the problems with it, I just might put all the sequence creation queries in the file.

         

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.