You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Allow generalized expression syntax for partition bounds
Previously, only literals were allowed. This change allows general
expressions, including functions calls, which are evaluated at the
time the DDL command is executed.
Besides offering some more functionality, it simplifies the parser
structures and removes some inconsistencies in how the literals were
handled.
Author: Kyotaro Horiguchi, Tom Lane, Amit Langote
Reviewed-by: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Discussion: https://www.postgresql.org/message-id/flat/9f88b5e0-6da2-5227-20d0-0d7012beaa1c@lab.ntt.co.jp/
WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REMAINDER <replaceable class="parameter">numeric_literal</replaceable> )
94
94
95
95
<phrase><replaceable class="parameter">index_parameters</replaceable> in <literal>UNIQUE</literal>, <literal>PRIMARY KEY</literal>, and <literal>EXCLUDE</literal> constraints are:</phrase>
@@ -413,12 +413,13 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
413
413
</para>
414
414
415
415
<para>
416
-
Each of the values specified in
417
-
the <replaceable class="parameter">partition_bound_spec</replaceable> is
418
-
a literal, <literal>NULL</literal>, <literal>MINVALUE</literal>, or
419
-
<literal>MAXVALUE</literal>. Each literal value must be either a
420
-
numeric constant that is coercible to the corresponding partition key
421
-
column's type, or a string literal that is valid input for that type.
416
+
<replaceable class="parameter">partition_bound_expr</replaceable> is
417
+
any variable-free expression (subqueries, window functions, aggregate
418
+
functions, and set-returning functions are not allowed). Its data type
419
+
must match the data type of the corresponding partition key column.
420
+
The expression is evaluated once at table creation time, so it can
0 commit comments