Hi, Ezequias,
Ezequias Rodrigues da Rocha wrote:
> I would like to overwrite a table with problem with his original. But
> there are some points.
>
> I can't just delete and restore it becouse it has a foreign key and
> when I try to delete it ask for drop cascade.
As long as the delete and restore is in the same transaction, SET
CONSTRAINTS ALL DEFERRED might help.
See the docs for more info.
> As I know the drop cascade delete in both tables the rows related. Is
> it correct ?
Yes, cascade will delete all referencing rows in the otehr table to keep
the constraints intact, keeping only those rows that have NULL in the
foreign key. I think that's not exactly what you want.
HTH,
Markus
--
Markus Schaber | Logical Tracking&Tracing International AG
Dipl. Inf. | Software Development GIS
Fight against software patents in Europe! www.ffii.org
www.nosoftwarepatents.org