Re: ERROR Inserting into partition

From: Sbob <sbob(at)quadratum-braccas(dot)com>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: "pgsql-performance(at)lists(dot)postgresql(dot)org" <pgsql-admin(at)lists(dot)postgresql(dot)org>
Subject: Re: ERROR Inserting into partition
Date: 2024-10-22 17:05:02
Message-ID: cfa50ec5-eca3-4aa3-aa6e-d22f969f3ee7@quadratum-braccas.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Thanks, it turns out it was subtle user error

On 10/22/24 8:53 AM, David G. Johnston wrote:
> On Tue, Oct 22, 2024 at 7:36 AM Sbob <sbob(at)quadratum-braccas(dot)com> wrote:
>
>
> 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).
>
>
> Also, I am unable to reproduce this in development:
>
> CREATE TABLE 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);
>
> CREATE TABLE cust_info_5
> PARTITION OF cust_part
> FOR VALUES IN ('NELL');
>
> create table global_addr (l_name text);
>
> insert into global_addr values ('NELL');
>
> INSERT INTO cust_info_5
> ( cust_last_name)
> SELECT l_name from global_addr WHERE l_name = 'NELL';
>
> David J.

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Daulat 2024-10-23 12:02:15 Postgres capacity planning.
Previous Message David G. Johnston 2024-10-22 14:53:34 Re: ERROR Inserting into partition