Postgresql layout work nearing something useable.