> > How much time passed after sequence creation till crash?
> >>
> >> About 5-10 seconds. I opened a transaction, created a sequence,
> >> created a temporary table with one column having NEXTVAL(seq) as
> > ^^^^^^^^^^^^^^^^^^^^^^^^^
> >> default, inserted some data into the table, committed the
> >> transaction.
> >> After that I ran my function, which crashed the backend after
> >> 3-4 seconds of work.
>
> Hmm. Maybe the WAL redo is messing things up??
It could mess up pg_class content, but it never deletes
files (currently).
Vadim