> > Have you considered using a sequence, rather than generating
> > new values
> > as shown above? The approach you are using is extremely fragile:
> > consider what happens if two backends try to insert at the
> same time.
>
> a sequence it is! thanks.
well, but then again, I want the default value of that field to be 1
greater than the max value, not the next value in a sequence.
The client application has the ability to change the value of that
field, but new records need to be max+1.
So I guess to make pg_dump happy, and to solve potential concurrency
issues, I need a trigger for that field? Or will I have the same
circular reference problem with a trigger?
eric