Louis-David Mitterrand <vindex+lists-pgsql-sql(at)apartia(dot)org> writes:
> When I run that function it seems the foreign keys are not properly
> updated and the data ends up in a mess.
Yeah? Could we see an actual example of what you're talking about?
And which PG version is this?
regards, tom lane