ERROR Inserting into partition - Mailing list pgsql-admin

From Sbob
Subject ERROR Inserting into partition
Date
Msg-id 7bc2cd63-dff7-46bf-9cca-ee950463f13a@quadratum-braccas.com
Whole thread Raw
Responses Re: ERROR Inserting into partition
Re: ERROR Inserting into partition
List pgsql-admin
All;


I have created a table that looks like this:

CREATE TABLE myschema.cust_part (
            cust_int_id     bigint,
           cust_ext_id    bigint,
           cust_tax_id   varchar(20),
           cust_dob        date,
           cust_dob_str   varchar(20),
          cust_last_name  varchar(100),
         cust_first_name   varchar(100),
          cust_middle_name  varchar(100),
         cust_addr1                text,
        cust_city                     text,
        cust_state                  text,
        cust_zip                     varchar(5)
) PARTITION BY LIST (cust_last_name);

and a partition that looks like this:

CREATE TABLE part_schema.cust_info_5
PARTITION OF myschema.cust_part
FOR VALUES IN ('NELL');



if I insert ONLY the partition  key column  via a select from another 
table it fails:

INSERT INTO part_schema.cust_info_5
( cust_last_name)
SELECT l_name from public.global_addr WHERE l_name = 'NELL';
ERROR:  new row for relation "cust_info_5" violates partition constraint
DETAIL:  Failing row containd (null, null, null, null, null, 'NELL', 
null, null, null, null, null,null).

However if I insert the values directly it works:

INSERT INTO part_schema.cust_info_5 VALUES (null, null, null, null, 
null, 'NELL', null, null, null, null, null,null)
;
INSERT 0 1



I'm stumped, this happens with other last name values as well such as 
'N', and 'SMITH' thoughts?

I get the same behavior if I insert based on a select of all the 
partition table columns

Thanks in advance





pgsql-admin by date:

Previous
From: "Buzas, Matthew Scott"
Date:
Subject: questions about pgsql & pgadmin4 + fatal no role detected
Next
From: "David G. Johnston"
Date:
Subject: Re: ERROR Inserting into partition