Uploaded image for project: 'phpBB3'
  1. phpBB3
  2. PHPBB3-8494

Cannot install two boards on the same postgresql database

    Details

    • Type: Bug
    • Status: Unverified Fix
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.0.5
    • Fix Version/s: 3.1.4-RC1
    • Component/s: Installation system
    • Labels:
      None
    • Environment:
      PHP Environment: 5.2.9
      Database: PostgreSQL 8.4.0

      Description

      Installing the first board on a postgresql database works as expected, however when installing a second on the same database (using a different table_prefix) the following error is thrown:

      install_install.php [ 1193 ]
       
      SQL : CREATE DOMAIN varchar_ci AS varchar(255) NOT NULL DEFAULT ''::character varying
       
      ERROR: type "varchar_ci" already exists

        Issue Links

          Activity

          Hide
          nickvergessen Joas Schilling added a comment -

          work around would be on the second install
          install/schemas/postgre_schema.sql
          find and delete:

          /*
          	Domain definition
          */
          CREATE DOMAIN varchar_ci AS varchar(255) NOT NULL DEFAULT ''::character varying;
           
          /*
          	Operation Functions
          */
          CREATE FUNCTION _varchar_ci_equal(varchar_ci, varchar_ci) RETURNS boolean AS 'SELECT LOWER($1) = LOWER($2)' LANGUAGE SQL STRICT;
          CREATE FUNCTION _varchar_ci_not_equal(varchar_ci, varchar_ci) RETURNS boolean AS 'SELECT LOWER($1) != LOWER($2)' LANGUAGE SQL STRICT;
          CREATE FUNCTION _varchar_ci_less_than(varchar_ci, varchar_ci) RETURNS boolean AS 'SELECT LOWER($1) < LOWER($2)' LANGUAGE SQL STRICT;
          CREATE FUNCTION _varchar_ci_less_equal(varchar_ci, varchar_ci) RETURNS boolean AS 'SELECT LOWER($1) <= LOWER($2)' LANGUAGE SQL STRICT;
          CREATE FUNCTION _varchar_ci_greater_than(varchar_ci, varchar_ci) RETURNS boolean AS 'SELECT LOWER($1) > LOWER($2)' LANGUAGE SQL STRICT;
          CREATE FUNCTION _varchar_ci_greater_equals(varchar_ci, varchar_ci) RETURNS boolean AS 'SELECT LOWER($1) >= LOWER($2)' LANGUAGE SQL STRICT;
           
          /*
          	Operators
          */
          CREATE OPERATOR <(
            PROCEDURE = _varchar_ci_less_than,
            LEFTARG = varchar_ci,
            RIGHTARG = varchar_ci,
            COMMUTATOR = >,
            NEGATOR = >=,
            RESTRICT = scalarltsel,
            JOIN = scalarltjoinsel);
           
          CREATE OPERATOR <=(
            PROCEDURE = _varchar_ci_less_equal,
            LEFTARG = varchar_ci,
            RIGHTARG = varchar_ci,
            COMMUTATOR = >=,
            NEGATOR = >,
            RESTRICT = scalarltsel,
            JOIN = scalarltjoinsel);
           
          CREATE OPERATOR >(
            PROCEDURE = _varchar_ci_greater_than,
            LEFTARG = varchar_ci,
            RIGHTARG = varchar_ci,
            COMMUTATOR = <,
            NEGATOR = <=,
            RESTRICT = scalargtsel,
            JOIN = scalargtjoinsel);
           
          CREATE OPERATOR >=(
            PROCEDURE = _varchar_ci_greater_equals,
            LEFTARG = varchar_ci,
            RIGHTARG = varchar_ci,
            COMMUTATOR = <=,
            NEGATOR = <,
            RESTRICT = scalargtsel,
            JOIN = scalargtjoinsel);
           
          CREATE OPERATOR <>(
            PROCEDURE = _varchar_ci_not_equal,
            LEFTARG = varchar_ci,
            RIGHTARG = varchar_ci,
            COMMUTATOR = <>,
            NEGATOR = =,
            RESTRICT = neqsel,
            JOIN = neqjoinsel);
           
          CREATE OPERATOR =(
            PROCEDURE = _varchar_ci_equal,
            LEFTARG = varchar_ci,
            RIGHTARG = varchar_ci,
            COMMUTATOR = =,
            NEGATOR = <>,
            RESTRICT = eqsel,
            JOIN = eqjoinsel,
            HASHES,
            MERGES,
            SORT1= <);

          Show
          nickvergessen Joas Schilling added a comment - work around would be on the second install install/schemas/postgre_schema.sql find and delete: /* Domain definition */ CREATE DOMAIN varchar_ci AS varchar(255) NOT NULL DEFAULT ''::character varying;   /* Operation Functions */ CREATE FUNCTION _varchar_ci_equal(varchar_ci, varchar_ci) RETURNS boolean AS 'SELECT LOWER($1) = LOWER($2)' LANGUAGE SQL STRICT; CREATE FUNCTION _varchar_ci_not_equal(varchar_ci, varchar_ci) RETURNS boolean AS 'SELECT LOWER($1) != LOWER($2)' LANGUAGE SQL STRICT; CREATE FUNCTION _varchar_ci_less_than(varchar_ci, varchar_ci) RETURNS boolean AS 'SELECT LOWER($1) < LOWER($2)' LANGUAGE SQL STRICT; CREATE FUNCTION _varchar_ci_less_equal(varchar_ci, varchar_ci) RETURNS boolean AS 'SELECT LOWER($1) <= LOWER($2)' LANGUAGE SQL STRICT; CREATE FUNCTION _varchar_ci_greater_than(varchar_ci, varchar_ci) RETURNS boolean AS 'SELECT LOWER($1) > LOWER($2)' LANGUAGE SQL STRICT; CREATE FUNCTION _varchar_ci_greater_equals(varchar_ci, varchar_ci) RETURNS boolean AS 'SELECT LOWER($1) >= LOWER($2)' LANGUAGE SQL STRICT;   /* Operators */ CREATE OPERATOR <( PROCEDURE = _varchar_ci_less_than, LEFTARG = varchar_ci, RIGHTARG = varchar_ci, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel);   CREATE OPERATOR <=( PROCEDURE = _varchar_ci_less_equal, LEFTARG = varchar_ci, RIGHTARG = varchar_ci, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarltsel, JOIN = scalarltjoinsel);   CREATE OPERATOR >( PROCEDURE = _varchar_ci_greater_than, LEFTARG = varchar_ci, RIGHTARG = varchar_ci, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel);   CREATE OPERATOR >=( PROCEDURE = _varchar_ci_greater_equals, LEFTARG = varchar_ci, RIGHTARG = varchar_ci, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargtsel, JOIN = scalargtjoinsel);   CREATE OPERATOR <>( PROCEDURE = _varchar_ci_not_equal, LEFTARG = varchar_ci, RIGHTARG = varchar_ci, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel);   CREATE OPERATOR =( PROCEDURE = _varchar_ci_equal, LEFTARG = varchar_ci, RIGHTARG = varchar_ci, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel, HASHES, MERGES, SORT1= <);
          Hide
          Kellanved Kellanved [X] (Inactive) added a comment -

          This is a restriction in the installer; the above manual workaround should work fine.

          ~H

          Show
          Kellanved Kellanved [X] (Inactive) added a comment - This is a restriction in the installer; the above manual workaround should work fine. ~H
          Hide
          Oleg Oleg [X] (Inactive) added a comment -

          We can solve it in one of three ways:

          1. Check if varchar_ci exists, if so don't create it. Problem is, if someone had that type for whatever reason in their database and it was different from ours we would not detect this situation.

          2. Add a checkbox to the installer if postgresql is selected to the effect of "I'm installing into a database which already had phpbb installed into it", in which case we assume there are no conflicting types.

          3. Try to load the schema as it is, if it fails prompt the user to check the error message and continue skipping repeated parts.

          Show
          Oleg Oleg [X] (Inactive) added a comment - We can solve it in one of three ways: 1. Check if varchar_ci exists, if so don't create it. Problem is, if someone had that type for whatever reason in their database and it was different from ours we would not detect this situation. 2. Add a checkbox to the installer if postgresql is selected to the effect of "I'm installing into a database which already had phpbb installed into it", in which case we assume there are no conflicting types. 3. Try to load the schema as it is, if it fails prompt the user to check the error message and continue skipping repeated parts.

            People

            • Assignee:
              nickvergessen Joas Schilling
              Reporter:
              jwb @ zoofware jwb @ zoofware
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development