Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[F] mybb1.4.2 and PostgreSQL
#11
(2008-10-17, 08:49 PM)laie_techie Wrote: Looks like the installation script forgot to create the proper sequences. For each table create a sequence using something like:

CREATE SEQUENCE mybb_userfields_ufid_seq

@ Denis - even with you changes #1 happens. I have created a patch which I will send you later. This fixes the Registration error.
#12
I've setup PostgreSQL boards before and I've never had an issue with having to create sequences specifically. It was my belief that PostgreSQL would setup the proper sequences when you created a column as a primary key
#13
(2008-10-21, 01:39 AM)Ryan Gordon Wrote: I've setup PostgreSQL boards before and I've never had an issue with having to create sequences specifically. It was my belief that PostgreSQL would setup the proper sequences when you created a column as a primary key

@ Denis - this is the patch that solved the problem.


Attached Files
.zip   mybb_1402.users.zip (Size: 571 bytes / Downloads: 347)
#14
(2008-10-21, 01:39 AM)Ryan Gordon Wrote: I've setup PostgreSQL boards before and I've never had an issue with having to create sequences specifically. It was my belief that PostgreSQL would setup the proper sequences when you created a column as a primary key

That's not right. In PostgreSQL there's the serial datatype. If you use this type for a column on creation of a database instead of an integer, this will create the sequence automatically. It's the same as 'integer auto_increment' in MySQL.
#15
Ah nevermind, it was just the userfields table that is special in the case that it has a primary key on ufid but it's not autoincrement
#16
Thank you for your bug report.

This bug has been fixed in our internal code repository. Please note that the problem will not be fixed here until these forums are updated.

With regards,
MyBB Group
#17
Revision #4249
(2008-10-16, 12:44 PM)kvikkjokk Wrote: Register a new user
MyBB has experienced an internal SQL error and cannot continue.

SQL Error:
0 - ERROR: relation "mybb_userfields_ufid_seq" does not exist
Query:
SELECT currval('mybb_userfields_ufid_seq') AS last_value
This issue isn't fixed properly. If you want to register you get this error:
Quote:MyBB has experienced an internal SQL error and cannot continue.
SQL Error:
55000 - ERROR: currval of sequence "trunk_userfields_ufid_seq" is not yet defined in this session
Query:
SELECT currval('trunk_userfields_ufid_seq') AS last_value
The same error appears if you want to add a new user via Admin-CP.
Greets,
Michael
-------------
[Image: donation_drive_sig.png]
#18
Yes, I get this error too.

In PostgreSQL you get an error, if you use currval in the actual db session an nextval wasn't executed before in that session.

http://www.postgresql.org/docs/8.3/inter...uence.html

I don't know what the query does, but you have to set the value for the sequence using nextval or setval first or instead of currval.
#19
(2008-11-16, 09:07 PM)Michael83 Wrote: Revision #4249
(2008-10-16, 12:44 PM)kvikkjokk Wrote: Register a new user
MyBB has experienced an internal SQL error and cannot continue.

SQL Error:
0 - ERROR: relation "mybb_userfields_ufid_seq" does not exist
Query:
SELECT currval('mybb_userfields_ufid_seq') AS last_value
This issue isn't fixed properly. If you want to register you get this error:
Quote:MyBB has experienced an internal SQL error and cannot continue.
SQL Error:
55000 - ERROR: currval of sequence "trunk_userfields_ufid_seq" is not yet defined in this session
Query:
SELECT currval('trunk_userfields_ufid_seq') AS last_value
The same error appears if you want to add a new user via Admin-CP.

I fixed these yesterday when I was setting up the test PostgreSQL forum on my dev server. I just haven't committed the fixes yet.
#20
All the reported PostgreSQL fixes should be in the SVN now


Forum Jump:


Users browsing this thread: 1 Guest(s)