joomla-projects / soc21_website-cronjob

GNU General Public License v2.0
5 stars 3 forks source link

[PostgreSQL] ENUM type declaration with exception handling fails #6

Closed ditsuke closed 3 years ago

ditsuke commented 3 years ago

Steps to reproduce the issue

Try installing Joomla with a PostgreSQL database and commit hash b130fc21cb7eea618f31d0011d4e093efcedd88e (branch plgapi). The installation fails with:

42601, 7, ERROR: cannot insert multiple commands into a prepared statement

UPDATE

As of the latest commit, I identified that moving the SQL before the declaration for soundex fixes the previous error (which was still occurring with the removal of enums)

Expected result

Joomla is able to run the DB complete scripts and complete installation.

Actual result

DB scripts fail when it gets to the ENUM type declarations.

image

System information (as much as possible)

Additional comments

DO $$ BEGIN CREATE TYPE trigger_type AS enum ('pseudo_cron', 'cron', 'visit_count'); EXCEPTION WHEN duplicate_object THEN NULL; END $$;