Skip to content

Conversation

@richard67
Copy link
Member

Pull Request for https://github.com/joomla/joomla-cms/pull/38149/files#r1265261563 .

Summary of Changes

PostgreSQL doesn't support "AFTER" in "ALTER TABLE ... ADD COLUMN ..." statements, see https://www.postgresql.org/docs/current/sql-altertable.html .

This pull request (PR) here fixes the wrong SQL statement added with PR #38149 .

Testing Instructions

Run the SQL statement changed by this PR on a PostgreSQL database with a 5.0-dev Joomla installation which doesn't have PR #38149 applied.

Actual result BEFORE applying this Pull Request

SQL syntax error.

Expected result AFTER applying this Pull Request

Column is added.

Link to documentations

Please select:

  • No documentation changes for docs.joomla.org needed

  • No documentation changes for manual.joomla.org needed

@HLeithner
Copy link
Member

does that mean postgresql adds the column always to the end?

@brianteeman
Copy link
Contributor

sorry about that

@richard67
Copy link
Member Author

does that mean postgresql adds the column always to the end?

@HLeithner Yes, and the same applies to other relational databases like Oracle, MS SQL Server, DB2, ... . Only MySQL and MariaDB support that. The order of columns in a table is absolutely irrelevant and so doesn't really matter.

@HLeithner
Copy link
Member

only if you don't care about your structure ;-) ok thanks

@HLeithner HLeithner merged commit 094f544 into joomla:5.0-dev Jul 17, 2023
@richard67 richard67 deleted the 5.0-dev-fix-sql-error-in-postgresql-update-script branch July 17, 2023 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants