[
https://issues.apache.org/jira/browse/SPARK-22717?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16280220#comment-16280220
]
Apache Spark commented on SPARK-22717:
--------------------------------------
User 'danielvdende' has created a pull request for this issue:
https://github.com/apache/spark/pull/19911
> Postgres is assumed to cascade truncate table by default which is not true
> --------------------------------------------------------------------------
>
> Key: SPARK-22717
> URL: https://issues.apache.org/jira/browse/SPARK-22717
> Project: Spark
> Issue Type: Bug
> Components: SQL
> Affects Versions: 2.2.2
> Environment: Postgres 8,9,10
> Reporter: Bolke de Bruin
>
> 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
> documentation[https://www.postgresql.org/docs/9.1/static/sql-truncate.html]
> {code}
> 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.
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]