> To attempt this security model, which can work if everything in the universe goes right for you
Almost all webapps we write, we write them this way. (on oracle, not postgres, but that makes no difference).
> your application needs to be designed for it from the very beginning.
That's true. As in "you can not add security later on".