7 Replies Latest reply on Nov 22, 2003 3:30 PM by julien1

    Finally, PostgreSQL scripts

    mrojas

      hi, i'm sorry very much for taking this long to upload the postgresql scripts, but finally here they are.

      i've tested in redhat 9 with jdk 1.4.2, jboss-3.2.2RC2 and postgresql 7.3.2-3.

      any comments/suggestions/corrections are welcom, and hope this helps to extend the user base of nukes on jboss.


      thanks, and best regards.

        • 1. Re: Finally, PostgreSQL scripts

          don't be that much sorry, you did what you said, that is the most important.

          I have put the file in the CVS and modified them to support few things that have changed. For what version was it based ? nukes-1.0.0 alpha ?

          I don't have postgre to test what I modified yet. If you can look at what I did and test it, that would be cool.

          julien

          • 2. Re: Finally, PostgreSQL scripts
            mrojas

            i've worked on a cvs version, but don't remember the date i've downloaded, anyway, tomorrow i'll download the mos recent cvs version and test it on my home.

            thanks.

            • 3. Re: Finally, PostgreSQL scripts
              jwr1

              Hi guys!

              I was glad to see the postgres scripts shortly after I have ported the ddl scripts by myself :-(

              I appreciate your work and have 2 comments:

              a)

              If you declare the primary key with the line

              pn_uid INTEGER DEFAULT NEXTVAL('nuke_users_pn_uid_seq') PRIMARY KEY,

              you must not add the line

              PRIMARY KEY (pn_uid)

              at the bottom of the create table statement. At least for me (postgresql 7.3 under redhat 9) this does not work.

              b)

              For the autoincrement feature we could use the postgres type SERIAL which automatically creates the corresponding sequence. This means, the following should work

              pn_uid SERIAL PRIMARY KEY,

              and maybe is more sound than your approach.

              Best regards from Austria,
              jwr.

              • 4. Re: Finally, PostgreSQL scripts
                mrojas

                > Hi guys!
                >
                > I was glad to see the postgres scripts shortly after
                > I have ported the ddl scripts by myself :-(
                >
                > I appreciate your work and have 2 comments:
                >
                > a)
                >
                > If you declare the primary key with the line
                >
                > pn_uid INTEGER DEFAULT
                > NEXTVAL('nuke_users_pn_uid_seq') PRIMARY KEY,
                >
                > you must not add the line
                >
                > PRIMARY KEY (pn_uid)

                that's true, i'll correct that one, sorry for the inconvenience

                >
                > at the bottom of the create table statement. At least
                > for me (postgresql 7.3 under redhat 9) this does not
                > work.
                >
                > b)
                >
                > For the autoincrement feature we could use the
                > postgres type SERIAL which automatically creates the
                > corresponding sequence. This means, the following
                > should work
                >
                > pn_uid SERIAL PRIMARY KEY,
                >
                > and maybe is more sound than your approach.

                yes, but i was getting some errors, because the code seems to look for a sequence name like the ones specified in my scripts, with the "_seq" at the end of the sequence name.

                i tried modifying the $JBOSS_HOME/server/default/conf/standardjbosscmp-jdbc.xml file, indicating to modify the default sequence name, but i didn't work. i must admit i'm new to jboss/j2ee development, so maybe i was looking in the wrong place, so maybe somebody else can point me in the rigth direction.

                >
                > Best regards from Austria,
                > jwr.
                >

                thanks for your suggestions, and greetings from mexico :)

                • 5. Re: Finally, PostgreSQL scripts

                  if you have any changes for the postgres ddl, please make them available

                  julien

                  • 6. Re: Finally, PostgreSQL scripts
                    jwr

                    Hi Julien,

                    I attach a new version of the postgres scripts.

                    I use the SERIAL data type for the primary keys, so that the sequences get automatically created and deleted with the appropriate tables. I also added create statements for indexes.

                    I hope that in the meantime (since 13.11.) there were no changes in the database structure, otherwise I'd have to incorporate them...

                    Regards,
                    jwr.

                    • 7. Re: Finally, PostgreSQL scripts

                      this has been commited