• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Unable to delete post: error SQL null value in column "log_id"

 
sebastien maye
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

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.

Can somebody helps me ? Thanks in advance !

Smile
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34209
341
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sebastien,
Welcome to CodeRanch!

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?
 
sebastien maye
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ?

thanks again.

Smile

 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34209
341
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
sebastien maye
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am double checking the facts. Here is some more informations:
Jforum's version: "Powered by JForum 2.3.3"
Postgres' version:

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 ?

Gratefully,

Smile
 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Has this ever worked, or is it a new phenomenon?
 
sebastien maye
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 !!

Smile
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
sebastien maye
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Roger.

I'll keep that in mind =)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic