-
Notifications
You must be signed in to change notification settings - Fork 69
Closed
Labels
Description
Postgresql version: 9.5
Table definitions (1K rows):
comment=# \d+ comment; Table "public.comment" Column | Type | Modifiers | Storage | Stats target | Description ----------------+-----------------------------+--------------------------------------------------------------+----------+--------------+------------- comment_id | integer | not null default nextval('comment_comment_id_seq'::regclass) | plain | | created_at | timestamp without time zone | not null | plain | | updated_at | timestamp without time zone | not null | plain | | entity_type_id | smallint | not null | plain | | entity_id | integer | not null | plain | | status_id | smallint | not null | plain | | comment_index | integer | not null | plain | | anonymously | boolean | not null | plain | | user_id | integer | not null | plain | | user_name | character varying(256) | not null | extended | | user_mail | character varying(256) | not null | extended | | user_cookie | character varying(32) | not null | extended | | user_ip | inet | not null | main | | user_agent_id | integer | not null | plain | | moderator_id | integer | not null | plain | | extra | jsonb | not null | extended | | body | text | not null | extended | | Indexes: "comment_pkey" PRIMARY KEY, btree (comment_id) "comment_entity_id_entity_type_id_comment_index_idx" btree (entity_id, entity_type_id, comment_index) Check constraints: "comment_comment_id_check" CHECK (0 < comment_id) "comment_comment_index_check" CHECK (0 <= comment_index) "comment_entity_id_check" CHECK (0 < entity_id) "comment_entity_type_id_check" CHECK (0 < entity_type_id) "comment_moderator_id_check" CHECK (0 <= moderator_id) "comment_status_id_check" CHECK (0 < status_id) "comment_user_agent_id_check" CHECK (0 <= user_agent_id) "comment_user_id_check" CHECK (0 <= user_id)
Result:
comment=# select create_range_partitions('comment', 'entity_id', 1, 10000); NOTICE: sequence "comment_seq" does not exist, skipping CONTEXT: SQL statement "DROP SEQUENCE IF EXISTS public.comment_seq" PL/pgSQL function create_or_replace_sequence(text,text) line 5 at EXECUTE SQL statement "SELECT public.create_or_replace_sequence(v_plain_schema, v_plain_relname)" PL/pgSQL function create_range_partitions(regclass,text,anyelement,anyelement,integer) line 49 at PERFORM WARNING: Wrong CHECK constraint for relation 'comment_2'. It MUST have exact format: VARIABLE >= CONST AND VARIABLE < CONST. Skipping... CONTEXT: SQL statement "SELECT public.on_create_partitions(p_relation::regclass::oid)" PL/pgSQL function create_range_partitions(regclass,text,anyelement,anyelement,integer) line 68 at PERFORM WARNING: Wrong CHECK constraint for relation 'comment_2'. It MUST have exact format: VARIABLE >= CONST AND VARIABLE < CONST. Skipping... CONTEXT: SQL statement "SELECT public.on_create_partitions(p_relation::regclass::oid)" PL/pgSQL function create_range_partitions(regclass,text,anyelement,anyelement,integer) line 68 at PERFORM WARNING: Wrong CHECK constraint for relation 'comment_2'. It MUST have exact format: VARIABLE >= CONST AND VARIABLE < CONST. Skipping... CONTEXT: SQL statement "SELECT public.on_create_partitions(p_relation::regclass::oid)" PL/pgSQL function create_range_partitions(regclass,text,anyelement,anyelement,integer) line 68 at PERFORM WARNING: Wrong CHECK constraint for relation 'comment_2'. It MUST have exact format: VARIABLE >= CONST AND VARIABLE < CONST. Skipping... CONTEXT: SQL statement "SELECT public.on_create_partitions(p_relation::regclass::oid)" PL/pgSQL function create_range_partitions(regclass,text,anyelement,anyelement,integer) line 68 at PERFORM WARNING: Wrong CHECK constraint for relation 'comment_2'. It MUST have exact format: VARIABLE >= CONST AND VARIABLE < CONST. Skipping... CONTEXT: SQL statement "SELECT public.on_create_partitions(p_relation::regclass::oid)" PL/pgSQL function create_range_partitions(regclass,text,anyelement,anyelement,integer) line 68 at PERFORM WARNING: Wrong CHECK constraint for relation 'comment_2'. It MUST have exact format: VARIABLE >= CONST AND VARIABLE < CONST. Skipping... CONTEXT: SQL statement "SELECT public.on_create_partitions(p_relation::regclass::oid)" PL/pgSQL function create_range_partitions(regclass,text,anyelement,anyelement,integer) line 68 at PERFORM WARNING: Wrong CHECK constraint for relation 'comment_2'. It MUST have exact format: VARIABLE >= CONST AND VARIABLE < CONST. Skipping... CONTEXT: SQL statement "SELECT public.on_create_partitions(p_relation::regclass::oid)" PL/pgSQL function create_range_partitions(regclass,text,anyelement,anyelement,integer) line 68 at PERFORM WARNING: Wrong CHECK constraint for relation 'comment_2'. It MUST have exact format: VARIABLE >= CONST AND VARIABLE < CONST. Skipping... CONTEXT: SQL statement "SELECT public.on_create_partitions(p_relation::regclass::oid)" PL/pgSQL function create_range_partitions(regclass,text,anyelement,anyelement,integer) line 68 at PERFORM WARNING: Wrong CHECK constraint for relation 'comment_3'. It MUST have exact format: VARIABLE >= CONST AND VARIABLE < CONST. Skipping... CONTEXT: SQL statement "SELECT public.on_create_partitions(p_relation::regclass::oid)" PL/pgSQL function create_range_partitions(regclass,text,anyelement,anyelement,integer) line 68 at PERFORM WARNING: Wrong CHECK constraint for relation 'comment_1'. It MUST have exact format: VARIABLE >= CONST AND VARIABLE < CONST. Skipping... CONTEXT: SQL statement "SELECT public.on_create_partitions(p_relation::regclass::oid)" PL/pgSQL function create_range_partitions(regclass,text,anyelement,anyelement,integer) line 68 at PERFORM WARNING: Wrong CHECK constraint for relation 'comment_1'. It MUST have exact format: VARIABLE >= CONST AND VARIABLE < CONST. Skipping... CONTEXT: SQL statement "SELECT public.on_create_partitions(p_relation::regclass::oid)" PL/pgSQL function create_range_partitions(regclass,text,anyelement,anyelement,integer) line 68 at PERFORM WARNING: Wrong CHECK constraint for relation 'comment_1'. It MUST have exact format: VARIABLE >= CONST AND VARIABLE < CONST. Skipping... CONTEXT: SQL statement "SELECT public.on_create_partitions(p_relation::regclass::oid)" PL/pgSQL function create_range_partitions(regclass,text,anyelement,anyelement,integer) line 68 at PERFORM WARNING: Wrong CHECK constraint for relation 'comment_1'. It MUST have exact format: VARIABLE >= CONST AND VARIABLE < CONST. Skipping... CONTEXT: SQL statement "SELECT public.on_create_partitions(p_relation::regclass::oid)" PL/pgSQL function create_range_partitions(regclass,text,anyelement,anyelement,integer) line 68 at PERFORM WARNING: Wrong CHECK constraint for relation 'comment_1'. It MUST have exact format: VARIABLE >= CONST AND VARIABLE < CONST. Skipping... CONTEXT: SQL statement "SELECT public.on_create_partitions(p_relation::regclass::oid)" PL/pgSQL function create_range_partitions(regclass,text,anyelement,anyelement,integer) line 68 at PERFORM WARNING: Wrong CHECK constraint for relation 'comment_1'. It MUST have exact format: VARIABLE >= CONST AND VARIABLE < CONST. Skipping... CONTEXT: SQL statement "SELECT public.on_create_partitions(p_relation::regclass::oid)" PL/pgSQL function create_range_partitions(regclass,text,anyelement,anyelement,integer) line 68 at PERFORM WARNING: Wrong CHECK constraint for relation 'comment_1'. It MUST have exact format: VARIABLE >= CONST AND VARIABLE < CONST. Skipping... CONTEXT: SQL statement "SELECT public.on_create_partitions(p_relation::regclass::oid)" PL/pgSQL function create_range_partitions(regclass,text,anyelement,anyelement,integer) line 68 at PERFORM WARNING: Wrong CHECK constraint for relation 'comment_1'. It MUST have exact format: VARIABLE >= CONST AND VARIABLE < CONST. Skipping... CONTEXT: SQL statement "SELECT public.on_create_partitions(p_relation::regclass::oid)" PL/pgSQL function create_range_partitions(regclass,text,anyelement,anyelement,integer) line 68 at PERFORM WARNING: Wrong CHECK constraint for relation 'comment_3'. It MUST have exact format: VARIABLE >= CONST AND VARIABLE < CONST. Skipping... CONTEXT: SQL statement "SELECT public.on_create_partitions(p_relation::regclass::oid)" PL/pgSQL function create_range_partitions(regclass,text,anyelement,anyelement,integer) line 68 at PERFORM WARNING: Wrong CHECK constraint for relation 'comment_3'. It MUST have exact format: VARIABLE >= CONST AND VARIABLE < CONST. Skipping... CONTEXT: SQL statement "SELECT public.on_create_partitions(p_relation::regclass::oid)" PL/pgSQL function create_range_partitions(regclass,text,anyelement,anyelement,integer) line 68 at PERFORM WARNING: Wrong CHECK constraint for relation 'comment_3'. It MUST have exact format: VARIABLE >= CONST AND VARIABLE < CONST. Skipping... CONTEXT: SQL statement "SELECT public.on_create_partitions(p_relation::regclass::oid)" PL/pgSQL function create_range_partitions(regclass,text,anyelement,anyelement,integer) line 68 at PERFORM WARNING: Wrong CHECK constraint for relation 'comment_3'. It MUST have exact format: VARIABLE >= CONST AND VARIABLE < CONST. Skipping... CONTEXT: SQL statement "SELECT public.on_create_partitions(p_relation::regclass::oid)" PL/pgSQL function create_range_partitions(regclass,text,anyelement,anyelement,integer) line 68 at PERFORM WARNING: Wrong CHECK constraint for relation 'comment_3'. It MUST have exact format: VARIABLE >= CONST AND VARIABLE < CONST. Skipping... CONTEXT: SQL statement "SELECT public.on_create_partitions(p_relation::regclass::oid)" PL/pgSQL function create_range_partitions(regclass,text,anyelement,anyelement,integer) line 68 at PERFORM WARNING: Wrong CHECK constraint for relation 'comment_3'. It MUST have exact format: VARIABLE >= CONST AND VARIABLE < CONST. Skipping... CONTEXT: SQL statement "SELECT public.on_create_partitions(p_relation::regclass::oid)" PL/pgSQL function create_range_partitions(regclass,text,anyelement,anyelement,integer) line 68 at PERFORM WARNING: Wrong CHECK constraint for relation 'comment_3'. It MUST have exact format: VARIABLE >= CONST AND VARIABLE < CONST. Skipping... CONTEXT: SQL statement "SELECT public.on_create_partitions(p_relation::regclass::oid)" PL/pgSQL function create_range_partitions(regclass,text,anyelement,anyelement,integer) line 68 at PERFORM WARNING: Wrong CHECK constraint for relation 'comment_4'. It MUST have exact format: VARIABLE >= CONST AND VARIABLE < CONST. Skipping... CONTEXT: SQL statement "SELECT public.on_create_partitions(p_relation::regclass::oid)" PL/pgSQL function create_range_partitions(regclass,text,anyelement,anyelement,integer) line 68 at PERFORM WARNING: Wrong CHECK constraint for relation 'comment_4'. It MUST have exact format: VARIABLE >= CONST AND VARIABLE < CONST. Skipping... CONTEXT: SQL statement "SELECT public.on_create_partitions(p_relation::regclass::oid)" PL/pgSQL function create_range_partitions(regclass,text,anyelement,anyelement,integer) line 68 at PERFORM WARNING: Wrong CHECK constraint for relation 'comment_4'. It MUST have exact format: VARIABLE >= CONST AND VARIABLE < CONST. Skipping... CONTEXT: SQL statement "SELECT public.on_create_partitions(p_relation::regclass::oid)" PL/pgSQL function create_range_partitions(regclass,text,anyelement,anyelement,integer) line 68 at PERFORM WARNING: Wrong CHECK constraint for relation 'comment_4'. It MUST have exact format: VARIABLE >= CONST AND VARIABLE < CONST. Skipping... CONTEXT: SQL statement "SELECT public.on_create_partitions(p_relation::regclass::oid)" PL/pgSQL function create_range_partitions(regclass,text,anyelement,anyelement,integer) line 68 at PERFORM WARNING: Wrong CHECK constraint for relation 'comment_4'. It MUST have exact format: VARIABLE >= CONST AND VARIABLE < CONST. Skipping... CONTEXT: SQL statement "SELECT public.on_create_partitions(p_relation::regclass::oid)" PL/pgSQL function create_range_partitions(regclass,text,anyelement,anyelement,integer) line 68 at PERFORM WARNING: Wrong CHECK constraint for relation 'comment_4'. It MUST have exact format: VARIABLE >= CONST AND VARIABLE < CONST. Skipping... CONTEXT: SQL statement "SELECT public.on_create_partitions(p_relation::regclass::oid)" PL/pgSQL function create_range_partitions(regclass,text,anyelement,anyelement,integer) line 68 at PERFORM WARNING: Wrong CHECK constraint for relation 'comment_4'. It MUST have exact format: VARIABLE >= CONST AND VARIABLE < CONST. Skipping... CONTEXT: SQL statement "SELECT public.on_create_partitions(p_relation::regclass::oid)" PL/pgSQL function create_range_partitions(regclass,text,anyelement,anyelement,integer) line 68 at PERFORM WARNING: Wrong CHECK constraint for relation 'comment_4'. It MUST have exact format: VARIABLE >= CONST AND VARIABLE < CONST. Skipping... CONTEXT: SQL statement "SELECT public.on_create_partitions(p_relation::regclass::oid)" PL/pgSQL function create_range_partitions(regclass,text,anyelement,anyelement,integer) line 68 at PERFORM WARNING: Wrong CHECK constraint for relation 'comment_5'. It MUST have exact format: VARIABLE >= CONST AND VARIABLE < CONST. Skipping... CONTEXT: SQL statement "SELECT public.on_create_partitions(p_relation::regclass::oid)" PL/pgSQL function create_range_partitions(regclass,text,anyelement,anyelement,integer) line 68 at PERFORM WARNING: Wrong CHECK constraint for relation 'comment_5'. It MUST have exact format: VARIABLE >= CONST AND VARIABLE < CONST. Skipping... CONTEXT: SQL statement "SELECT public.on_create_partitions(p_relation::regclass::oid)" PL/pgSQL function create_range_partitions(regclass,text,anyelement,anyelement,integer) line 68 at PERFORM WARNING: Wrong CHECK constraint for relation 'comment_5'. It MUST have exact format: VARIABLE >= CONST AND VARIABLE < CONST. Skipping... CONTEXT: SQL statement "SELECT public.on_create_partitions(p_relation::regclass::oid)" PL/pgSQL function create_range_partitions(regclass,text,anyelement,anyelement,integer) line 68 at PERFORM WARNING: Wrong CHECK constraint for relation 'comment_5'. It MUST have exact format: VARIABLE >= CONST AND VARIABLE < CONST. Skipping... CONTEXT: SQL statement "SELECT public.on_create_partitions(p_relation::regclass::oid)" PL/pgSQL function create_range_partitions(regclass,text,anyelement,anyelement,integer) line 68 at PERFORM WARNING: Wrong CHECK constraint for relation 'comment_5'. It MUST have exact format: VARIABLE >= CONST AND VARIABLE < CONST. Skipping... CONTEXT: SQL statement "SELECT public.on_create_partitions(p_relation::regclass::oid)" PL/pgSQL function create_range_partitions(regclass,text,anyelement,anyelement,integer) line 68 at PERFORM WARNING: Wrong CHECK constraint for relation 'comment_5'. It MUST have exact format: VARIABLE >= CONST AND VARIABLE < CONST. Skipping... CONTEXT: SQL statement "SELECT public.on_create_partitions(p_relation::regclass::oid)" PL/pgSQL function create_range_partitions(regclass,text,anyelement,anyelement,integer) line 68 at PERFORM WARNING: Wrong CHECK constraint for relation 'comment_5'. It MUST have exact format: VARIABLE >= CONST AND VARIABLE < CONST. Skipping... CONTEXT: SQL statement "SELECT public.on_create_partitions(p_relation::regclass::oid)" PL/pgSQL function create_range_partitions(regclass,text,anyelement,anyelement,integer) line 68 at PERFORM WARNING: Wrong CHECK constraint for relation 'comment_5'. It MUST have exact format: VARIABLE >= CONST AND VARIABLE < CONST. Skipping... CONTEXT: SQL statement "SELECT public.on_create_partitions(p_relation::regclass::oid)" PL/pgSQL function create_range_partitions(regclass,text,anyelement,anyelement,integer) line 68 at PERFORM WARNING: Partitions 0 and 0 overlap. Disabling pathman for relation 22848... CONTEXT: SQL statement "SELECT public.on_create_partitions(p_relation::regclass::oid)" PL/pgSQL function create_range_partitions(regclass,text,anyelement,anyelement,integer) line 68 at PERFORM WARNING: Partitions 0 and 0 overlap. Disabling pathman for relation 22848... CONTEXT: SQL statement "SELECT public.on_create_partitions(p_relation::regclass::oid)" PL/pgSQL function create_range_partitions(regclass,text,anyelement,anyelement,integer) line 68 at PERFORM WARNING: Partitions 0 and 0 overlap. Disabling pathman for relation 22848... CONTEXT: SQL statement "SELECT public.on_create_partitions(p_relation::regclass::oid)" PL/pgSQL function create_range_partitions(regclass,text,anyelement,anyelement,integer) line 68 at PERFORM WARNING: Partitions 0 and 0 overlap. Disabling pathman for relation 22848... CONTEXT: SQL statement "SELECT public.on_create_partitions(p_relation::regclass::oid)" PL/pgSQL function create_range_partitions(regclass,text,anyelement,anyelement,integer) line 68 at PERFORM WARNING: Partitions 0 and 0 overlap. Disabling pathman for relation 22848... CONTEXT: SQL statement "SELECT public.on_create_partitions(p_relation::regclass::oid)" PL/pgSQL function create_range_partitions(regclass,text,anyelement,anyelement,integer) line 68 at PERFORM WARNING: Partitions 0 and 0 overlap. Disabling pathman for relation 22848... CONTEXT: SQL statement "SELECT public.on_create_partitions(p_relation::regclass::oid)" PL/pgSQL function create_range_partitions(regclass,text,anyelement,anyelement,integer) line 68 at PERFORM WARNING: Partitions 0 and 0 overlap. Disabling pathman for relation 22848... CONTEXT: SQL statement "SELECT public.on_create_partitions(p_relation::regclass::oid)" PL/pgSQL function create_range_partitions(regclass,text,anyelement,anyelement,integer) line 68 at PERFORM WARNING: Partitions 0 and 0 overlap. Disabling pathman for relation 22848... CONTEXT: SQL statement "SELECT public.on_create_partitions(p_relation::regclass::oid)" PL/pgSQL function create_range_partitions(regclass,text,anyelement,anyelement,integer) line 68 at PERFORM NOTICE: Copying data to partitions... CONTEXT: SQL statement "SELECT public.partition_data(p_relation)" PL/pgSQL function create_range_partitions(regclass,text,anyelement,anyelement,integer) line 71 at PERFORM ERROR: ERROR: Cannot find partition P0001