Hi Norman,

I tried some things yesterday, but the results are not really encouraging :-(

The database tables for Postgresql must use
- bytea instead of blob
- boolean instead of the integers in message_flags
- serial instead of the autoincrement

The last point (serial) imposes a big problem. IMHO, the Torque adapter for Postgresql is severely flawed in that regard!

Torque tries to access the sequence associated with a table to get the current id. In Postgresql, the default name for the sequence is "tablename_columnname_seq". For the mailbox table this means the sequence is named "mailbox_mailbox_id_seq".

Unfortunately, the Postgresql adapter tries to access it by the name "mailbox". Not even creating a sequence manually can help here, as Postgresql doesn't allow the same name for a table and a sequence!

A workaround would be to use Torque generated ids instead of "NATIVE" as it is in the sources. But theses source files seem to be generated by Torque, so I didn't want to fiddle with them.

I didn't give up, though, and tried to use an own version of the adapter ...

I was able to fix this specific problem, and James runs now without any error messages. Unfortunately, it doesn't store any messages in the database either ...

I'm not sure if I want to invest more time into this problem, because to me it seems like Torque and Postgresql are not a good combination in the first place! I need to get James running as my main mail server in the next 2 - 3 weeks, and as the IMAP support is only experimental I don't want to use an unsupported database underneath.

Still, do you know how to make Torque log the SQL statements it produces?

Michael

Norman Maurer schrieb:
Hi Michael,

i have not postgresql db to test at the moment. But you can give the
attached diff a try. Please give us feedback .

Bye
Norman

Michael Baehr schrieb:
Oh, I just see that in mailboxManagerSqlResources.xml there is nothing
for Postgresql!

Does somebody (Norman?) have the correct SQL statements (I'm not a DB
expert at all)?

Michael

Michael Baehr schrieb:
Hi there,

I got James (trunk) running successfully. Now I wanted to replace the
default Derby database with  Postgresql 8.1.

I made the necessary changes in the config.xml (so far only in the
Mailboxmanager-Section, as I'm using IMAP), but I get a NPE:

java.lang.NullPointerException
       at
org.postgresql.jdbc2.AbstractJdbc2Statement.replaceProcessing(AbstractJdbc2Statement.java:765)

       at
org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:338)

       at
org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:286)

       at
org.apache.torque.util.BasePeer.executeStatement(BasePeer.java:1292)
       at
org.apache.james.mailboxmanager.torque.TorqueMailboxManagerFactory.initialize(TorqueMailboxManagerFactory.java:109)


My section in config.xml:

                       <torque-properties>
                           <property name="torque.database.default"
                               value="mailboxmanager"/>
                           <property
name="torque.database.mailboxmanager.adapter"
                               value="postgresql"/>
                           <property
name="torque.dsfactory.mailboxmanager.factory" value="org.apache.torque.dsfactory.SharedPoolDataSourceFactory"/>
                           <property
name="torque.dsfactory.mailboxmanager.connection.driver"
                               value="org.postgresql.Driver"/>
                           <property
name="torque.dsfactory.mailboxmanager.connection.url" value="jdbc:postgresql://localhost/james"/>
                           <property
name="torque.dsfactory.mailboxmanager.connection.user"
                               value="james"/>
                           <property
name="torque.dsfactory.mailboxmanager.connection.password"
                               value="james"/>
                           <property
name="torque.dsfactory.mailboxmanager.pool.maxActive"
                               value="100"/>
                       </torque-properties>

Do I have to create the database tables myself? If yes, how?

Michael


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

!EXCUBATOR:1,45db389c39079122512689!


------------------------------------------------------------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to