Skip to content

[3.0]: Error while trying to upgrade from 2.1 on PostgreSQL #9018

@Oldiesmann

Description

@Oldiesmann

Basic Information

Attempting to upgrade to 3.0 from 2.1 results in a database error

Steps to reproduce

  1. Install SMF 2.1 on PostgreSQL
  2. Attempt to upgrade to 3.0

Expected result

Upgrade completes successfully

Actual result

[michael@michaelarch smf215]$ php upgrade.php
2025-10-29T13:59:20+00:00
Step 1: Login
Making sure SMF can write to "/srv/http/smf215/Settings.php"... done.
Making sure SMF can write to "/srv/http/smf215/Settings_bak.php"... done.
Making sure SMF can write to "/srv/http/smf215/custom_avatar"... done.
Making sure SMF can write to "/srv/http/smf215/cache/db_last_error.php"... done.
Step 2: Upgrade Options
Saving the following settings in the settings table: enable_sm_stats... done.
Step 4: Migrations
 +++ Fixing sequences (PostgreSQL)... PHP Warning:  Undefined array key 0 in /srv/http/smf215/Sources/Maintenance/Migration/v2_1/PostgreSqlSequences.php on line 208
PHP Warning:  Trying to access array offset on null in /srv/http/smf215/Sources/Maintenance/Migration/v2_1/PostgreSqlSequences.php on line 214
PHP Warning:  Trying to access array offset on null in /srv/http/smf215/Sources/Maintenance/Migration/v2_1/PostgreSqlSequences.php on line 215
Unsuccessful!  Database error message:
ERROR:  syntax error at or near "NULL"
LINE 1: ...CT setval('smf_0', (SELECT COALESCE(MAX(NULL),1) FROM NULL))

Version/Git revision

3.0 Alpha 4

Database Engine

PostgreSQL

Database Version

17.6

PHP Version

8.4.14

Logs

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    PostgreSQLRegressionA recent change has introduced a new bug.

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions