This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I'm facing a problem when i try to delete a posts with an admin user. Jform send me the following error message:
org.postgresql.util.PSQLException: ERROR: null value in column "log_id" violates not-null constraint
Détail : Failing row contains (null, 13, dd, réponse de test, 2013-09-26 16:57:06.129, 1, 49485, 0, 69).
I'm using Jforum 2.3.3 with Postgres 9 and all i know is that the fisrt field, which is null, is the result of a sequence "jforum_categories_seq".
The sequence works fine, the number returned is correct, so I can't figure how the insert in the "jforum_moderation_log" contains a null value.
log_id is the primary key for that table and set using a sequence (or the like depending on your database). It shouldn't be possible for it to be null. Is it possible you are running a database type set that doesn't match your actual database?
Thanks for the warm welcome and the quick answer !
The thing is that all the others features, and most of them use sequence, work fine: create posts, users, replies...
At first i though about a data problem cause the content of the database is the result of a migration from an Oracle Database, but i can't see how it could be related to my problem.
Could you be a bit more specific about the "type set" ? Is there some sort of incompatibility between Postgres and Jforum ?
author & internet detective
I was thinking of the following lines in SystemGlobals.properties. In particular, I was wondering if maybe it didn't match your database name. We are using postgres so there certainly isn't a fundamental incompatibility!
Data migration does raise a good point. Do you have any nulls in the log_id field now? And can you double check the database has the sequence set on the jforum_moderation_log table. I'm wondering if the key or constraint got dropped somehow.
Joined: Sep 26, 2013
I am double checking the facts. Here is some more informations:
Jforum's version: "Powered by JForum 2.3.3"
The content of the SystemGlobal.properties
The content of the jforum_moderation_log table, in which there is no null value in the column "log_id", the constraint is well inforced (CONSTRAINT jforum_moderation_log_pkey PRIMARY KEY (log_id)).
The sequence which working fine:
I was wondering, can it be a problem caused by the jdbc drivers ? We're using in the glassfish's lib directory "postgresql-9.1-902.jdbc4.jar".
Also, i deleted with SQL requests, thousands of anonymous posts from bots, can i broke something doing so ?
You can do a quick check on the DB side. Just fire a valid insert query to that table from an SQL editor and see if the column gets an auto generated value from the sequence. If that works, then it's something on the JForum integration side that's wrong.
Thanks all for your trails !
After trying to insert into this table, I received:
The table jforum_moderation_log is defined as follow in our database:
Whereas the update script from 2.1.7 to 2.1.8 states:
Seems like the migration was half done...
Thanks again !!
Joined: Mar 22, 2005
Be aware that JForum 2.1.* (the last version by the original developer) is a different beast than JForum 2.3.* (a fork that is hosted at Google Code). While care was taken to maintain compatibility, you may not be able to transfer DBs between the two versions without further work.
Joined: Sep 26, 2013
I'll keep that in mind =)
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
subject: Unable to delete post: error SQL null value in column "log_id"