@@ -16,18 +16,28 @@ SELECT COUNT(*) FROM test_exprs.hash_rel;
1616 5
1717(1 row)
1818
19+ SELECT create_hash_partitions('test_exprs.hash_rel', 'random()', 4);
20+ ERROR: functions in partitioning expression must be marked IMMUTABLE
1921\set VERBOSITY default
2022SELECT create_hash_partitions('test_exprs.hash_rel', 'value * value2))', 4);
2123ERROR: partitioning expression parse error
2224DETAIL: syntax error at or near ")"
23- QUERY: SELECT public.add_to_pathman_config(parent_relid, expression)
24- CONTEXT: PL/pgSQL function create_hash_partitions(regclass,text,integer,boolean,text[],text[]) line 9 at PERFORM
25+ QUERY: SELECT public.validate_expression(parent_relid, expression)
26+ CONTEXT: PL/pgSQL function prepare_for_partitioning(regclass,text,boolean) line 9 at PERFORM
27+ SQL statement "SELECT public.prepare_for_partitioning(parent_relid,
28+ expression,
29+ partition_data)"
30+ PL/pgSQL function create_hash_partitions(regclass,text,integer,boolean,text[],text[]) line 4 at PERFORM
2531SELECT create_hash_partitions('test_exprs.hash_rel', 'value * value3', 4);
2632ERROR: partitioning expression analyze error
2733DETAIL: column "value3" does not exist
2834HINT: Perhaps you meant to reference the column "hash_rel.value" or the column "hash_rel.value2".
29- QUERY: SELECT public.add_to_pathman_config(parent_relid, expression)
30- CONTEXT: PL/pgSQL function create_hash_partitions(regclass,text,integer,boolean,text[],text[]) line 9 at PERFORM
35+ QUERY: SELECT public.validate_expression(parent_relid, expression)
36+ CONTEXT: PL/pgSQL function prepare_for_partitioning(regclass,text,boolean) line 9 at PERFORM
37+ SQL statement "SELECT public.prepare_for_partitioning(parent_relid,
38+ expression,
39+ partition_data)"
40+ PL/pgSQL function create_hash_partitions(regclass,text,integer,boolean,text[],text[]) line 4 at PERFORM
3141\set VERBOSITY terse
3242SELECT create_hash_partitions('test_exprs.hash_rel', 'value * value2', 4);
3343 create_hash_partitions
@@ -88,7 +98,7 @@ CREATE TABLE test_exprs.range_rel (id SERIAL PRIMARY KEY, dt TIMESTAMP, txt TEXT
8898INSERT INTO test_exprs.range_rel (dt, txt)
8999SELECT g, md5(g::TEXT) FROM generate_series('2015-01-01', '2020-04-30', '1 month'::interval) as g;
90100SELECT create_range_partitions('test_exprs.range_rel', 'RANDOM()', '15 years'::INTERVAL, '1 year'::INTERVAL, 10);
91- ERROR:start value is less than min value of "random()"
101+ ERROR:functions in partitioning expression must be marked IMMUTABLE
92102SELECT create_range_partitions('test_exprs.range_rel', 'AGE(dt, ''2000-01-01''::DATE)',
93103'15 years'::INTERVAL, '1 year'::INTERVAL, 10);
94104 create_range_partitions