Rein Petersen <email@reinpetersen.com> writes:
> ERROR: syntax error at or near "BY"
> LINE 16: WINDOW w AS ( PARITION BY locationid, partindex ORDER BY cr...
> ^
If you really spelled it like that, "PARTITION BY" should work better.
regards, tom lane