Repository navigation
JSPWIKI-1374 Make the PostgreSQL user database script run on PostgreSQL - #641
Open
arturobernalg wants to merge 1 commit into
Open
arturobernalg wants to merge 1 commit into
arturobernalg wants to merge 1 commit into
Conversation
The script ended the column list of the users table with a comma and used HSQL types, so the table was not created. It also used the HSQL comment character and an option of create user that PostgreSQL no longer accepts, and it did not define the oldhashes column. The e-mail column is compared ignoring case, as the lookup of JDBCUserDatabase needs, through a non deterministic collation; a citext column is compared as text by the JDBC driver and does not do that.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
postgresql.ddlhas never run on PostgreSQL: the column list of theuserstable ends with a comma and uses HSQL types (longvarchar,varchar_ignorecase), the commented out drops use the HSQL comment character,create useruses an option PostgreSQL no longer accepts, and theoldhashescolumn thatJDBCUserDatabasewrites is not defined (same gap as #639 for HSQL).The e-mail column keeps the case insensitive comparison that
findByEmail(WHERE email=?) relies on, through a non deterministic ICU collation, which needs PostgreSQL 12 or later. Acitextcolumn was tried first: the JDBC driver sends the e-mail as text and the comparison is then case sensitive.Executed on PostgreSQL 16: the script runs without errors on an empty database and a second time on top of itself. As the
jspwikiuser, with the pgjdbc 42.7.13 driver, the INSERT ofJDBCUserDatabasestores a user,SELECT * FROM users WHERE email=?finds it with the e-mail in other case, the UPDATE works and theadminrole is read. On master the script fails on theuserstable.