<cnliou(at)eurosport(dot)com> writes:
> I am afraid that this too-complete example makes
> readers headache.
I'm afraid you omitted some detail that's necessary to show the
problem ... because it works fine for me.
Please try to make a pg_dump script that can be loaded into a fresh
database to produce the problem. I'm not willing to hand-edit SELECT
output into INSERT statements again.
regards, tom lane