Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-22717

Postgres is assumed to cascade truncate table by default which is not true

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Invalid
    • 2.2.1
    • None
    • SQL
    • None
    • Postgres 8,9,10

    Description

      The postgres dialect returns True for isCascadingTruncateTable, which is mentioned to be returned (https://github.com/apache/spark/blob/d4107196d59638845bd19da6aab074424d90ddaf/sql/core/src/main/scala/org/apache/spark/sql/jdbc/JdbcDialects.scala#L152) to indicate that it cascades by default. This is not true accoriding to the documentationhttps://www.postgresql.org/docs/9.1/static/sql-truncate.html

      domino=> truncate domino.info;
      ERROR:  cannot truncate a table referenced in a foreign key constraint
      DETAIL:  Table "fix" references "info".
      HINT:  Truncate table "fix" at the same time, or use TRUNCATE ... CASCADE.
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            bolke Bolke de Bruin
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: