On 2016/08/10 19:18, Ashutosh Bapat wrote: > FOR VALUE clause of a partition does not allow a constant expression like > (10000/5 -1). It gives syntax error > regression=# create table pt1_p1 partition of pt1 for values start (0) end > ((10000/5) - 1); > ERROR: syntax error at or near "(" > LINE 1: ...pt1_p1 partition of pt1 for values start (0) end ((10000/5) ... > > Shouldn't we allow constant expressions here? > > If this has been already discussed, please forgive me and point out the > relevant mail chain.
Yes, the only allowed values there are string literals, numeric values and null. Decision to change to it followed from this comment: "Also, I don't think allowing an a_expr as a bound is remotely sensible - I think you should allow only Sconst, NumericOnly, NULL, and UNBOUNDED." https://www.postgresql.org/message-id/CA%2BTgmoZ1ZMCyGR3b9yvGDq79xYLMnJQwhwn5GVs_GsvPiySDxw%40mail.gmail.com Thanks, Amit -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers