Andy Fan <zhihui.fan1...@gmail.com> writes: > Well, that's very interesting. Specific to my user case, > SELECT * FROM p WHERE pkey = to_date('2018-12-13', 'yyyy-mm-dd)'; > p has 1500+ partitions and planning takes lots of time, which is so same > with SELECT * FROM p WHERE pkey = '2018-12-13', however the planning > time difference is so huge, that doesn't make sense in human view. Can > we do something for that? to_date(text, text) should be a "immutable" > function IMO. Does that have a semantic issue or other issues?
Yeah. It depends on the lc_time setting, and possibly also the timezone GUC. (Admittedly, common values of the format string would not have any lc_time dependency, but the immutability property is not fine-grained enough to recognize that.) regards, tom lane