Andy Colson <andy(at)squeakycode(dot)net> writes:
> now now we have a membership record (100), but no customer record.
I haven't really been following this thread, but: isn't the answer
to that to establish a foreign-key constraint? If there's an FK
then the database will provide sufficient row locking to prevent
you from deleting a row that someone else is in the midst of creating
a reference to.
regards, tom lane