? Pending

User tests: Successful: Unsuccessful:

avatar richard67
richard67
21 Apr 2017

Pull Request for no issue.

Summary of Changes

This PR adds the "IF EXISTS" condition to all "CREATE TABLE" statements in any SQL scripts for Postgresql as supported since Postgresql version 9.1, so the Postgresql SQL scripts work in the same way as the SQL scripts for mysql.

See http://stackoverflow.com/questions/1766046/postgresql-create-table-if-not-exists and https://www.postgresql.org/docs/9.2/static/sql-createtable.html regarding the "CREATE TABLE IF EXISTS" support in Postgresql.

Following kinds of scripts are affected:

  • Joomla installation script joomla.sql or Postgresql
  • All present schema update SQL scripts for Postgresql
  • All present special installation SQL scripts for Postgresql (currently only one for com_finder)

These 3 kinds of changes have been added with separate commits so they can be cherry-picked by a maintainer if this PR is not acceptable completely, e.g. in case PLT hates changes on old schema update SQL scripts.

The database schema manager's change item class for Postgresql already supports the "CREATE TABLE IF EXISTS" statements and so does not need to be changed, see https://github.com/joomla/joomla-cms/blob/4.0-dev/libraries/src/CMS/Schema/ChangeItem/PostgresqlChangeItem.php#L194

Testing Instructions

  • Code review: Check e.g. with findstr on MS Windows or grep on Linux or in an editor with a search function that all "CREATE TABLE" statements in the changed files have been changed, no statement has been forgotten.
  • New Joomla installation: All works like before, result is same as without this PR.
  • Joomla Update: Works like before, result is same as without this PR.
  • Database schema manager: Extensions -> Manage -> Database shows same results and same number of statements as without this PR.

Expected result

All works like before, result is same as without this PR.

Actual result

Same as expected result.

Documentation Changes Required

None.

avatar richard67 richard67 - open - 21 Apr 2017
avatar richard67 richard67 - change - 21 Apr 2017
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 21 Apr 2017
Category Postgresql SQL Administration com_admin com_finder Installation
avatar richard67 richard67 - change - 21 Apr 2017
The description was changed
avatar richard67 richard67 - edited - 21 Apr 2017
avatar richard67
richard67 - comment - 21 Apr 2017

Corrected grammar in description.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/15446.

avatar richard67 richard67 - change - 21 Apr 2017
The description was changed
avatar richard67 richard67 - edited - 21 Apr 2017
avatar richard67
richard67 - comment - 21 Apr 2017

Added half sentence to explain motivation of this PR (make SQL scripts for Postgresql work the same way as for mysql).


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/15446.

avatar richard67 richard67 - change - 21 Apr 2017
The description was changed
avatar richard67
richard67 - comment - 21 Apr 2017

Typo corrected.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/15446.

avatar richard67 richard67 - edited - 21 Apr 2017
avatar zero-24
zero-24 - comment - 21 Apr 2017

looks good from review but why do you send this against 4.0-dev and not staging (to be included in 3.7.1?

avatar richard67
richard67 - comment - 21 Apr 2017

@zero-24 Because pre-4.0 Joomla has to support pre-9.1 Postgresql ;-)

avatar zero-24
zero-24 - comment - 21 Apr 2017

Ah ok ignotre my question. @wilsonge requested it to be against 4.0-dev

avatar wilsonge wilsonge - change - 21 Apr 2017
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2017-04-21 13:17:46
Closed_By wilsonge
Labels Added: ?
avatar wilsonge wilsonge - close - 21 Apr 2017
avatar wilsonge wilsonge - merge - 21 Apr 2017

Add a Comment

Login with GitHub to post a comment