Tom Lane wrote:
Well, if you allow for whitespace between tokens then it's immediately
clear that there is no fixed upper bound.

Good point -- there is no upper bound on the input string, but since we skip whitespace, AFAICS this shouldn't affect the requirements for the size of the working buffer (lowstr). So if we passed the size of the working buffer to ParseDateTime() (per earlier gripe), we could only bail out when we actually need to use more working space than was allocated, not simply when strlen(input) >= sizeof(buffer). The implementation might be a bit ugly, though.


Perhaps it would work to downcase just one token at a time, so that
the max buffer length equals the max acceptable token?

Not sure I follow you.

-Neil

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Reply via email to