postgresql returns the full timestamp including the time which screws up some procs which assume that the date returned is formatted as YYYY-MM-DD. a simple to_char statement fixes the problem
fixed sort key calculation. postgres driver encloses bind variables in ' ' which makes the sort key calculation fail. the key calculation is done in tcl now.