Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1t3IJm-00BhHS-RN for pgsql-admin@arkaria.postgresql.org; Tue, 22 Oct 2024 17:05:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1t3IJj-001bes-3H for pgsql-admin@arkaria.postgresql.org; Tue, 22 Oct 2024 17:05:11 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1t3IJh-001bdc-EG for pgsql-admin@lists.postgresql.org; Tue, 22 Oct 2024 17:05:11 +0000 Received: from fhigh-b5-smtp.messagingengine.com ([202.12.124.156]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1t3IJe-002JlM-D4 for pgsql-admin@lists.postgresql.org; Tue, 22 Oct 2024 17:05:08 +0000 Received: from phl-compute-11.internal (phl-compute-11.phl.internal [10.202.2.51]) by mailfhigh.stl.internal (Postfix) with ESMTP id 9977725400B6; Tue, 22 Oct 2024 13:05:04 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-11.internal (MEProxy); Tue, 22 Oct 2024 13:05:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= quadratum-braccas.com; h=cc:cc:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1729616704; x=1729703104; bh=4Et5qL+XdxEj9rOOkQBjiPORHkuiBkqDbn7KyerBkZ0=; b= VPQJEmdSEzxffwn/mZLwf5Y5eybNSPLPAweM0Xvw8F/oOMC+l62kHTwQ/Wj0U2oM zK+27l15OROb1bD7/G8okHdDYO+Mq8I48EVl+E+1dsVW0d7iQEm3ulCgAwOuTYAc 4KB9FHgJckLlJkxD/EzZg74gPVdyuRVeHNfM1B/+NtlyPm3Cz68PRLeI3pzMm/BZ OGLcyK3HKg8EfcsXPNjXMWVHgIebEzg5BQPNsb1AxxK60XUYu1d4WIdKYqllfTIC mFfjeiwTz5AoDfYd230sHmuINAkGBljccWFDWJtLPexh0kVr4C3OlCYGZjonCFH3 wDFs1h1C5p2FAbQgDJKi7g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; t=1729616704; x=1729703104; bh=4Et5qL+XdxEj9rOOkQBjiPORHkui BkqDbn7KyerBkZ0=; b=eary2xJnrCOz8x8ELWOQMb1L2qE3r59E+sQ0sjD8/8TW PScG1H289eRH32nzfftgWOWxaeCfbOxN/ojFUR2qN844z1/gtnDBh+Pos8wMiHr/ Dm47mXaDw0wVd9Sj0dL/ywZVCzW5I4vrAbq9gz4ethDPVlENXy5+4sW6oJvyukdQ NPRn6Ydujb/PW10ubQ895IqgbbJH8OsgUST8mJ3C3KF9IsAaUKg7jW5nhmFVsXfT c8u48fyrmqaOMsu6P3/16RjWIWtbhE1XLkHJo9ujBN+o3FdN1L4hMsxYqeeeqQnP eMNp8TxHqaIArqFVmjuV1YRLaUYd+4eUO/8xOgzoyw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvdeihedguddtkecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpegtkfffgggfuffvvehfhfgjsegrtderredtvdej necuhfhrohhmpefusghosgcuoehssghosgesqhhurggurhgrthhumhdqsghrrggttggrsh drtghomheqnecuggftrfgrthhtvghrnhepieetleektefhgeeutdegvdeggfelfedtvefg vddugeejffduhfejjeeggfeuledunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrg hmpehmrghilhhfrhhomhepshgsohgssehquhgrughrrghtuhhmqdgsrhgrtggtrghsrdgt ohhmpdhnsggprhgtphhtthhopeefpdhmohguvgepshhmthhpohhuthdprhgtphhtthhope gurghvihgurdhgrdhjohhhnhhsthhonhesghhmrghilhdrtghomhdprhgtphhtthhopehp ghhsqhhlqdgrughmihhnsehlihhsthhsrdhpohhsthhgrhgvshhqlhdrohhrghdprhgtph htthhopehssghosgesqhhurggurhgrthhumhdqsghrrggttggrshdrtghomh X-ME-Proxy: Feedback-ID: i374947ac:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 22 Oct 2024 13:05:03 -0400 (EDT) Content-Type: multipart/alternative; boundary="------------YQf9kNaDagQWkcb9agJv9UH3" Message-ID: Date: Tue, 22 Oct 2024 11:05:02 -0600 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: ERROR Inserting into partition To: "David G. Johnston" Cc: "pgsql-performance@lists.postgresql.org" References: <7bc2cd63-dff7-46bf-9cca-ee950463f13a@quadratum-braccas.com> Content-Language: en-US From: Sbob In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------YQf9kNaDagQWkcb9agJv9UH3 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 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 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. --------------YQf9kNaDagQWkcb9agJv9UH3 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit

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@quadratum-braccas.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.
--------------YQf9kNaDagQWkcb9agJv9UH3--