Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-1224

QueryBuilder delete issues CREATE TEMPORARY TABLE error on PostgreSQL

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.1
    • Fix Version/s: 2.0.7, 2.1
    • Component/s: ORM
    • Security Level: All
    • Labels:
      None
    • Environment:
      PostgreSQL 8.4

      Description

      When I try to issue a delete an Class Table Inheritance Entity using QueryBuilder and I'm using schemas on tablename (for Postgres), I got the following error from postgres:

      SQLSTATE[42P16]: Invalid table definition: 7 ERROR: temporary tables cannot specify a schema name

      This occurs because Doctrine\ORM\Mapping\ClassMetadataInfo::getTemporaryIdTableName() returns just "$this->table['name'] . '_id_tmp'", and when my entity is declared with @Table(name="feed.tb_feed"), obviously I will got error.

      Temporary tables are created in a special schema in Postgres, and I'm thinking to convert the tablename from the class metadata from feed.tb_feed to feed_tb_feed into the getTemporaryIdTableName method with a single str_replace. That works for Postgres, but I don't mind what can happen in another DBMS.

      Any suggestions?

        Activity

        Hide
        Benjamin Eberlei added a comment -

        Fixed

        Show
        Benjamin Eberlei added a comment - Fixed

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Rafael Kassner
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: