|
"create new forum" generates postgresql error
|
|
07-02-2009, 08:48 PM
Post: #1
|
|||
|
|||
|
"create new forum" generates postgresql error
Using pgsql 8.3.7 on CentOS 5.3, on a brand new 1.4.8 test install...
Almost the very first thing I did after finishing the install was to go to Admin CP, Forums, and try and add a new forum, and get... Code: MyBB SQL ErrorI ran into this in my original (now live) forum... apparently the default category and forum were pre-created with a pkey of '1' and '2', but the sequence associated with the SERIAL "fid" was not advanced, so this first INSERT is trying to insert forum #1. see... Code: mybbtest=# select fid,name from mybb_forums;I'm guessing the 'fix' is to NOT hardcode the fid=1 and fid=2 for the default category/forum (eg, use DEFAULT, or don't insert the field at all), or to manually advance the sequence by invoking select nextval('mybb_forums_fid_seq'::regclass); twice. |
|||
|
07-02-2009, 09:04 PM
Post: #2
|
|||
|
|||
|
RE: "create new forum" generates postgresql error
We don't hardcode fid=1 or fid=2 in the query - This looks like a PostgreSQL bug to me
![]() My Blog - My Mods |
|||
|
07-02-2009, 09:27 PM
Post: #3
|
|||
|
|||
RE: "create new forum" generates postgresql error
(07-02-2009 09:04 PM)Ryan Gordon Wrote: We don't hardcode fid=1 or fid=2 in the query - This looks like a PostgreSQL bug to me oh? Code: install/resources/mysql_db_inserts.php:$inserts[] = "INSERT INTO mybb_forums (fid, name, description, linkto, type, pid, parentlist, disporder, active, open, threads, posts, lastpost, lastposter, lastposttid, allowhtml, allowmycode, allowsmilies, allowimgcode, allowpicons, allowtratings, status, usepostcounts, password, showinjump, modposts, modthreads, modattachments, style, overridestyle, rulestype, rulestitle, rules) VALUES (1, 'My Category', '', '', 'c', 0, '1', 1, 1, 1, 0, 0, 0, '0', 0, 0, 1, 1, 1, 1, 1, 1, 1, '', 1, 0, 0, 0, 0, 0, 0, '', '');";looks hard coded to me ? |
|||
|
07-02-2009, 09:33 PM
Post: #4
|
|||
|
|||
|
RE: "create new forum" generates postgresql error
Ah, you quoted a different query - I took that as the one you were talking about.
![]() My Blog - My Mods |
|||
|
07-02-2009, 09:55 PM
Post: #5
|
|||
|
|||
|
RE: "create new forum" generates postgresql error
yeah, sorry. i should have been clearer, what I meant was the original insertion queries bypassed the DEFAULT expression for the SERIAL, so the associated sequence didn't get advanced. this is a 'feature' of how pg's SERIAL is implemented (its just an integer field that has an associated sequence, and default nextval() expression....
|
|||
|
08-19-2009, 06:02 AM
Post: #6
|
|||
|
|||
|
RE: "create new forum" generates postgresql error
It should have something like:
Code: update mybb_forums_fid_seq set last_value=2 |
|||
|
08-20-2009, 06:31 PM
Post: #7
|
|||
|
|||
|
RE: "create new forum" generates postgresql error
Corresponding ticket: http://dev.mybboard.net/issues/385
Greets, Michael ------------- German MyBB-Site MyBBoard.de Get the german languagepack here |
|||
|
« Next Oldest | Next Newest »
|
Search
Member List
Calendar
Help


![[Image: ryangordon.png]](http://files.bellomandesign.com/signatures/mybb/ryangordon.png)

