Em 14/06/2016 10:32, David G. Johnston escreveu:
Running the risk to deviate the focus, if records are ordered in the query, limiting them will always produce same result.
Yes, but is also impossible to get this error if the record is not in the subquery results. That's why I've executed the query filtering id=3240124. If this record is not in the subquery, why does the "delete..." is trying to remove it?
Yes, first thing. All references are maintained by a automated system. If the relation is not there, then it will be automatically created. But your question raised another interesting line of investigation: if there is any other cascading foreign keys pointing to A table. Until now, I've been concentrated in the related tables, but would be possible that another FK is cascading, which in turn would have another cascade that is causing the error.
Started with 9.0, then 9.1, 9.2, 9.3 and now 9.4. Nevertheless, for every migration I've used a "dump" and "restore" to avoid the "upgrade" caveats. For example, when migrating from 9.3 to 9.4, I've used "9.4" pg_dump to create the dump, and then "9.4" pg_restore to restore it in the new cluster. Edson
|