Sorry, s/downcased/downcased and null-terminated/. I have not read the parsing code in question lately, but offhand it seems like transferring one token at a time into a work buffer isn't a completely broken idea...
I wouldn't call it "broken", but I don't see how it could be done without a significant refactoring of how datetime parsing is done, and your handwaving has yet to convince me :) The gist of the current code is:
1. parse the input string into fields, which are arrays of pointers into a working buffer, via ParseDateTime()
2. decode the fields as appropriate for the datatype via DecodeInterval(), DecodeDatetime(), DecodeTimeOnly(), etc.
i.e. I don't see an easy way to do field decoding one field at a time.
-Neil
---------------------------(end of broadcast)--------------------------- TIP 4: Don't 'kill -9' the postmaster