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 1tGCOW-001Tgp-3w for pgsql-general@arkaria.postgresql.org; Wed, 27 Nov 2024 07:23:28 +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 1tGCOU-00Cihh-CY for pgsql-general@arkaria.postgresql.org; Wed, 27 Nov 2024 07:23:26 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tGCOT-00CihY-V7 for pgsql-general@lists.postgresql.org; Wed, 27 Nov 2024 07:23:26 +0000 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1tGCOR-004Hf4-6i for pgsql-general@lists.postgresql.org; Wed, 27 Nov 2024 07:23:25 +0000 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-434a90fed23so8296215e9.1 for ; Tue, 26 Nov 2024 23:23:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1732692202; x=1733297002; darn=lists.postgresql.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=sgqsWZJpjGGEP9qV/4tjV6c8yx0V61fbZ6T7wyA2Oxw=; b=Ww1YDET6X0Lpw2KhRhz/L2Jwz0UMdaDE6Jy3wg8270bZze+mgM52w40J9PZZdfalPg P9jVWSlHMZLb/oKuEMzQHRR2HJ++5xYyq154zNw6ATLsAe7GXlRmYMv5idzglgwhlPTq 2BCoud5Azi4reduelh7zzc+lYCIdXOEtXaTkw0D54yJoIDnqP/8ydfAtLN2+trVdcDSU IzprWgU2j/tdoH0jqNxX1Z0SCjV+cw0jlM5+0l0ZIB31LbgJk5sZ6bkbY9uWz9WvfyvB o2gPocqSToquV1LgDfHgmdI1Ppj+dccIu2/pGPlcNDybDXA8LJVAuu1Ofa9Dq63cHCaA HBdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732692202; x=1733297002; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=sgqsWZJpjGGEP9qV/4tjV6c8yx0V61fbZ6T7wyA2Oxw=; b=vsXLiIBR1ews4alfYUKcQBU+Wyw3KP4FjVZ5R9smYehJ7I+OMvoHNw2oDEaQcHo2gj X/pBDg80kqiAxJfyHBhDZ5WVSWi7kDj+VAorETlLK5yh4gp9YIlKkfm5j472/P9BULlZ e4LDqpVvE4GfTE7Dk1fkze3lHoFNUQaIMXqHIxfjdwAZhk5Z7/y+9/duiw8ZXmLIx+OQ cN8ma/FMk5kSKQW8XKZTWWx4zHTCRvOpKvfObmG+xNzG1wpVALuvhj1CnUgliCpEKYa+ NvpP/XVpzKxNmwJ3jRnXcdAxQQ5Z7Eby+dfHcUKXnGmYsGSwa5MRbyb2GxTzUkSy54h7 A/kQ== X-Forwarded-Encrypted: i=1; AJvYcCVd7hjZxZMNFjG7k30hhiy+qqnXXwbEbvAiPV+JzR0rqDXGiVL+UFiwCwxbbFqWw9NUWFvqgyfaX3WK1jCs@lists.postgresql.org X-Gm-Message-State: AOJu0YwkM5RgNWMwj4rhg/E2YNWvpbGBi8dogEMFYpMdcV9OmSoPWbYA t8+4oRKMXxS0gNuS/qKQc/xUe5c74nWMQFVSWp+M+WjJtEg+tRhreMpsFw== X-Gm-Gg: ASbGncvM0/EzB6214ZWYX2hkpcPDu06tRju73bnZmHPMVHx1rMqZ2TsrW7A4Kwr0xS4 KUnNkySA4JpbHe/A35annOTE43O0MPB8tqbKqJh4CZcSTxQIOb9dKNPUWixX0fw2bLr9RpV3k4/ gGzojIq46tE7sp2cK0dMAiQLbk2ysYUN4JnZcQS9VTHICBLfbjVwxh5yPPNQXgqiVxqllsN8d/3 axQxWbsqmy5JOJekDidg6PWpONfNYzUgE8e9IqcMXsmEqPTa0hCPDNzDzslRDfxosimaw6G2hs4 j0j79/7Qo1AXVXnugLPKXO/2p7w= X-Google-Smtp-Source: AGHT+IHkEbmRmDWsRDus6RoY8s0/y19q8N9w2SVQ35RR/OyBplUuz1DRJU9MkenbQ1X0tTzGlWlF9g== X-Received: by 2002:a05:600c:354e:b0:434:a802:e9b2 with SMTP id 5b1f17b1804b1-434a9dbc589mr16602995e9.4.1732692201620; Tue, 26 Nov 2024 23:23:21 -0800 (PST) Received: from smtpclient.apple (143-45-239-77.dyn.cable.qlnet.ch. [77.239.45.143]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-434aa78120dsm11609885e9.24.2024.11.26.23.23.19 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Nov 2024 23:23:20 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.200.121\)) Subject: Re: PostgreSQL 15.10 update corrective action for ATTACH PARTITION/DETACH PARTITION From: Paul Foerster In-Reply-To: <1723211.1732656332@sss.pgh.pa.us> Date: Wed, 27 Nov 2024 08:22:49 +0100 Cc: Adrian Klaver , pgsql-general list Content-Transfer-Encoding: quoted-printable Message-Id: References: <5456A1D0-CD47-4315-9C65-71B27E7A2906@gmail.com> <78ec2af8-48f2-42c0-b317-cbb77cc5adc8@aklaver.com> <1723211.1732656332@sss.pgh.pa.us> To: Tom Lane X-Mailer: Apple Mail (2.3826.200.121) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi Tom, > On 26 Nov 2024, at 22:25, Tom Lane wrote: >=20 > I would have expected an empty result too. Can you confirm that > p_ci_pipelines used to be a partition of something? Can you show us > the full DDL (or psql \d+ output) for the partitioned table it > used to be part of, and for that matter also for p_ci_pipelines? > Did the FK used to reference the whole partitioned table, or just > this partition? >=20 > I'm suspicious that our repair recipe might not have accounted > for self-reference FKs fully, but that's just a gut feeling at > this point. Of course, it contains no secret data. Please find the full log below. = According to the add constraint statement, it is a self reference. Thanks for looking into it. Cheers, Paul gitxp1t=3D# \set AUTOCOMMIT =3D 'on' ... VERSION =3D 'PostgreSQL 15.10 on x86_64-pc-linux-gnu, compiled by gcc = (SUSE Linux) 7.5.0, 64-bit' ... gitxp1t=3D# SELECT conrelid::pg_catalog.regclass AS "constrained table", gitxp1t-# conname AS constraint, gitxp1t-# confrelid::pg_catalog.regclass AS "references", gitxp1t-# pg_catalog.format('ALTER TABLE %s DROP CONSTRAINT %I;', gitxp1t(# conrelid::pg_catalog.regclass, = conname) AS "drop", gitxp1t-# pg_catalog.format('ALTER TABLE %s ADD CONSTRAINT %I = %s;', gitxp1t(# conrelid::pg_catalog.regclass, = conname, gitxp1t(# pg_catalog.pg_get_constraintdef(oid)) = AS "add" gitxp1t-# FROM pg_catalog.pg_constraint c gitxp1t-# WHERE contype =3D 'f' AND conparentid =3D 0 AND gitxp1t-# (SELECT count(*) FROM pg_catalog.pg_constraint c2 gitxp1t(# WHERE c2.conparentid =3D c.oid) <> gitxp1t-# (SELECT count(*) FROM pg_catalog.pg_inherits i gitxp1t(# WHERE (i.inhparent =3D c.conrelid OR i.inhparent =3D = c.confrelid) AND gitxp1t(# EXISTS (SELECT 1 FROM pg_catalog.pg_partitioned_table gitxp1t(# WHERE partrelid =3D i.inhparent)); constrained table | constraint | references | = drop | = = add = -------------------+-----------------+----------------+-------------------= ------------------------------------------+-------------------------------= --------------------------------------------------------------------------= --------------------------------------------------------------------------= --------------------------- p_ci_pipelines | fk_262d4c2d19_p | p_ci_pipelines | ALTER TABLE = p_ci_pipelines DROP CONSTRAINT fk_262d4c2d19_p; | ALTER TABLE = p_ci_pipelines ADD CONSTRAINT fk_262d4c2d19_p FOREIGN KEY = (auto_canceled_by_partition_id, auto_canceled_by_id) REFERENCES = p_ci_pipelines(partition_id, id) ON UPDATE CASCADE ON DELETE SET NULL; (1 row) gitxp1t=3D# ALTER TABLE p_ci_pipelines DROP CONSTRAINT fk_262d4c2d19_p; ALTER TABLE gitxp1t=3D# ALTER TABLE p_ci_pipelines ADD CONSTRAINT fk_262d4c2d19_p = FOREIGN KEY (auto_canceled_by_partition_id, auto_canceled_by_id) = REFERENCES p_ci_pipelines(partition_id, id) ON UPDATE CASCADE ON DELETE = SET NULL; ALTER TABLE gitxp1t=3D# SELECT conrelid::pg_catalog.regclass AS "constrained table", gitxp1t-# conname AS constraint, gitxp1t-# confrelid::pg_catalog.regclass AS "references", gitxp1t-# pg_catalog.format('ALTER TABLE %s DROP CONSTRAINT %I;', gitxp1t(# conrelid::pg_catalog.regclass, = conname) AS "drop", gitxp1t-# pg_catalog.format('ALTER TABLE %s ADD CONSTRAINT %I = %s;', gitxp1t(# conrelid::pg_catalog.regclass, = conname, gitxp1t(# pg_catalog.pg_get_constraintdef(oid)) = AS "add" gitxp1t-# FROM pg_catalog.pg_constraint c gitxp1t-# WHERE contype =3D 'f' AND conparentid =3D 0 AND gitxp1t-# (SELECT count(*) FROM pg_catalog.pg_constraint c2 gitxp1t(# WHERE c2.conparentid =3D c.oid) <> gitxp1t-# (SELECT count(*) FROM pg_catalog.pg_inherits i gitxp1t(# WHERE (i.inhparent =3D c.conrelid OR i.inhparent =3D = c.confrelid) AND gitxp1t(# EXISTS (SELECT 1 FROM pg_catalog.pg_partitioned_table gitxp1t(# WHERE partrelid =3D i.inhparent)); constrained table | constraint | references | = drop | = = add = -------------------+-----------------+----------------+-------------------= ------------------------------------------+-------------------------------= --------------------------------------------------------------------------= --------------------------------------------------------------------------= --------------------------- p_ci_pipelines | fk_262d4c2d19_p | p_ci_pipelines | ALTER TABLE = p_ci_pipelines DROP CONSTRAINT fk_262d4c2d19_p; | ALTER TABLE = p_ci_pipelines ADD CONSTRAINT fk_262d4c2d19_p FOREIGN KEY = (auto_canceled_by_partition_id, auto_canceled_by_id) REFERENCES = p_ci_pipelines(partition_id, id) ON UPDATE CASCADE ON DELETE SET NULL; (1 row) gitxp1t=3D# \d+ p_ci_pipelines = Partitioned table "public.p_ci_pipelines" Column | Type | Collation = | Nullable | Default | Storage | = Compression | Stats target | Description = -------------------------------+-----------------------------+-----------+= ----------+------------------------------------------+----------+---------= ----+--------------+------------- ref | character varying | = | | | extended | = | | sha | character varying | = | | | extended | = | | before_sha | character varying | = | | | extended | = | | created_at | timestamp without time zone | = | | | plain | = | | updated_at | timestamp without time zone | = | | | plain | = | | tag | boolean | = | | false | plain | = | | yaml_errors | text | = | | | extended | = | | committed_at | timestamp without time zone | = | | | plain | = | | project_id | integer | = | | | plain | = | | status | character varying | = | | | extended | = | | started_at | timestamp without time zone | = | | | plain | = | | finished_at | timestamp without time zone | = | | | plain | = | | duration | integer | = | | | plain | = | | user_id | integer | = | | | plain | = | | lock_version | integer | = | | 0 | plain | = | | pipeline_schedule_id | integer | = | | | plain | = | | source | integer | = | | | plain | = | | config_source | integer | = | | | plain | = | | protected | boolean | = | | | plain | = | | failure_reason | integer | = | | | plain | = | | iid | integer | = | | | plain | = | | merge_request_id | integer | = | | | plain | = | | source_sha | bytea | = | | | extended | = | | target_sha | bytea | = | | | extended | = | | external_pull_request_id | bigint | = | | | plain | = | | ci_ref_id | bigint | = | | | plain | = | | locked | smallint | = | not null | 1 | plain | = | | partition_id | bigint | = | not null | | plain | = | | id | bigint | = | not null | nextval('ci_pipelines_id_seq'::regclass) | plain | = | | auto_canceled_by_id | bigint | = | | | plain | = | | auto_canceled_by_partition_id | bigint | = | | | plain | = | | Partition key: LIST (partition_id) Indexes: "p_ci_pipelines_pkey" PRIMARY KEY, btree (id, partition_id) "p_ci_pipelines_auto_canceled_by_id_idx" btree (auto_canceled_by_id) "p_ci_pipelines_ci_ref_id_id_idx" btree (ci_ref_id, id) WHERE locked = =3D 1 "p_ci_pipelines_ci_ref_id_id_source_status_idx" btree (ci_ref_id, id = DESC, source, status) WHERE ci_ref_id IS NOT NULL "p_ci_pipelines_external_pull_request_id_idx" btree = (external_pull_request_id) WHERE external_pull_request_id IS NOT NULL "p_ci_pipelines_id_idx" btree (id) WHERE source =3D 13 "p_ci_pipelines_merge_request_id_idx" btree (merge_request_id) WHERE = merge_request_id IS NOT NULL "p_ci_pipelines_pipeline_schedule_id_id_idx" btree = (pipeline_schedule_id, id) "p_ci_pipelines_project_id_id_idx" btree (project_id, id DESC) "p_ci_pipelines_project_id_iid_partition_id_idx" UNIQUE, btree = (project_id, iid, partition_id) WHERE iid IS NOT NULL "p_ci_pipelines_project_id_ref_id_idx" btree (project_id, ref, id = DESC) "p_ci_pipelines_project_id_ref_status_id_idx" btree (project_id, = ref, status, id) "p_ci_pipelines_project_id_sha_idx" btree (project_id, sha) "p_ci_pipelines_project_id_source_idx" btree (project_id, source) "p_ci_pipelines_project_id_status_config_source_idx" btree = (project_id, status, config_source) "p_ci_pipelines_project_id_status_created_at_idx" btree (project_id, = status, created_at) "p_ci_pipelines_project_id_status_updated_at_idx" btree (project_id, = status, updated_at) "p_ci_pipelines_project_id_user_id_status_ref_idx" btree = (project_id, user_id, status, ref) WHERE source <> 12 "p_ci_pipelines_status_id_idx" btree (status, id) "p_ci_pipelines_user_id_created_at_config_source_idx" btree = (user_id, created_at, config_source) "p_ci_pipelines_user_id_created_at_source_idx" btree (user_id, = created_at, source) "p_ci_pipelines_user_id_id_idx" btree (user_id, id) WHERE = status::text =3D ANY (ARRAY['running'::character varying::text, = 'waiting_for_resource'::character varying::text, 'preparing'::character = varying::text, 'pending'::character varying::text, 'created'::character = varying::text, 'scheduled'::character varying::text]) "p_ci_pipelines_user_id_id_idx1" btree (user_id, id DESC) WHERE = failure_reason =3D 3 Check constraints: "check_2ba2a044b9" CHECK (project_id IS NOT NULL) Foreign-key constraints: "fk_190998ef09" FOREIGN KEY (external_pull_request_id) REFERENCES = external_pull_requests(id) ON DELETE SET NULL "fk_262d4c2d19_p" FOREIGN KEY (auto_canceled_by_partition_id, = auto_canceled_by_id) REFERENCES p_ci_pipelines(partition_id, id) ON = UPDATE CASCADE ON DELETE SET NULL "fk_3d34ab2e06" FOREIGN KEY (pipeline_schedule_id) REFERENCES = ci_pipeline_schedules(id) ON DELETE SET NULL "fk_d80e161c54" FOREIGN KEY (ci_ref_id) REFERENCES ci_refs(id) ON = DELETE SET NULL Referenced by: TABLE "p_ci_pipelines" CONSTRAINT "fk_262d4c2d19_p" FOREIGN KEY = (auto_canceled_by_partition_id, auto_canceled_by_id) REFERENCES = p_ci_pipelines(partition_id, id) ON UPDATE CASCADE ON DELETE SET NULL TABLE "ci_pipeline_chat_data" CONSTRAINT "fk_64ebfab6b3_p" FOREIGN = KEY (partition_id, pipeline_id) REFERENCES p_ci_pipelines(partition_id, = id) ON UPDATE CASCADE ON DELETE CASCADE TABLE "p_ci_builds" CONSTRAINT "fk_87f4cefcda_p" FOREIGN KEY = (upstream_pipeline_partition_id, upstream_pipeline_id) REFERENCES = p_ci_pipelines(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE TABLE "p_ci_builds" CONSTRAINT "fk_a2141b1522_p" FOREIGN KEY = (auto_canceled_by_partition_id, auto_canceled_by_id) REFERENCES = p_ci_pipelines(partition_id, id) ON UPDATE CASCADE ON DELETE SET NULL TABLE "p_ci_builds" CONSTRAINT "fk_d3130c9a7f_p" FOREIGN KEY = (partition_id, commit_id) REFERENCES p_ci_pipelines(partition_id, id) ON = UPDATE CASCADE ON DELETE CASCADE TABLE "ci_sources_pipelines" CONSTRAINT "fk_d4e29af7d7_p" FOREIGN = KEY (source_partition_id, source_pipeline_id) REFERENCES = p_ci_pipelines(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE TABLE "ci_sources_pipelines" CONSTRAINT "fk_e1bad85861_p" FOREIGN = KEY (partition_id, pipeline_id) REFERENCES p_ci_pipelines(partition_id, = id) ON UPDATE CASCADE ON DELETE CASCADE TABLE "p_ci_pipeline_variables" CONSTRAINT "fk_f29c5f4380_p" FOREIGN = KEY (partition_id, pipeline_id) REFERENCES p_ci_pipelines(partition_id, = id) ON UPDATE CASCADE ON DELETE CASCADE TABLE "p_ci_stages" CONSTRAINT "fk_fb57e6cc56_p" FOREIGN KEY = (partition_id, pipeline_id) REFERENCES p_ci_pipelines(partition_id, id) = ON UPDATE CASCADE ON DELETE CASCADE TABLE "ci_sources_projects" CONSTRAINT "fk_rails_10a1eb379a_p" = FOREIGN KEY (partition_id, pipeline_id) REFERENCES = p_ci_pipelines(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE TABLE "gitlab_partitions_dynamic.ci_builds_101" CONSTRAINT = "fk_rails_4540ead625_p" FOREIGN KEY (upstream_pipeline_partition_id, = upstream_pipeline_id) REFERENCES p_ci_pipelines(partition_id, id) ON = UPDATE CASCADE ON DELETE CASCADE NOT VALID TABLE "gitlab_partitions_dynamic.ci_builds_102" CONSTRAINT = "fk_rails_4540ead625_p" FOREIGN KEY (upstream_pipeline_partition_id, = upstream_pipeline_id) REFERENCES p_ci_pipelines(partition_id, id) ON = UPDATE CASCADE ON DELETE CASCADE NOT VALID TABLE "ci_builds" CONSTRAINT "fk_rails_4540ead625_p" FOREIGN KEY = (upstream_pipeline_partition_id, upstream_pipeline_id) REFERENCES = p_ci_pipelines(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE NOT = VALID TABLE "gitlab_partitions_dynamic.ci_builds_101" CONSTRAINT = "fk_rails_494e57ee78_p" FOREIGN KEY (auto_canceled_by_partition_id, = auto_canceled_by_id) REFERENCES p_ci_pipelines(partition_id, id) ON = UPDATE CASCADE ON DELETE SET NULL NOT VALID TABLE "ci_builds" CONSTRAINT "fk_rails_494e57ee78_p" FOREIGN KEY = (auto_canceled_by_partition_id, auto_canceled_by_id) REFERENCES = p_ci_pipelines(partition_id, id) ON UPDATE CASCADE ON DELETE SET NULL = NOT VALID TABLE "gitlab_partitions_dynamic.ci_builds_102" CONSTRAINT = "fk_rails_494e57ee78_p" FOREIGN KEY (auto_canceled_by_partition_id, = auto_canceled_by_id) REFERENCES p_ci_pipelines(partition_id, id) ON = UPDATE CASCADE ON DELETE SET NULL NOT VALID TABLE "ci_pipeline_variables" CONSTRAINT "fk_rails_507416c33a_p" = FOREIGN KEY (partition_id, pipeline_id) REFERENCES = p_ci_pipelines(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE NOT = VALID TABLE "gitlab_partitions_dynamic.ci_pipeline_variables_102" = CONSTRAINT "fk_rails_507416c33a_p" FOREIGN KEY (partition_id, = pipeline_id) REFERENCES p_ci_pipelines(partition_id, id) ON UPDATE = CASCADE ON DELETE CASCADE NOT VALID TABLE "ci_pipeline_metadata" CONSTRAINT "fk_rails_50c1e9ea10_p" = FOREIGN KEY (partition_id, pipeline_id) REFERENCES = p_ci_pipelines(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE TABLE "gitlab_partitions_dynamic.ci_stages_102" CONSTRAINT = "fk_rails_5d4d96d44b_p" FOREIGN KEY (partition_id, pipeline_id) = REFERENCES p_ci_pipelines(partition_id, id) ON UPDATE CASCADE ON DELETE = CASCADE NOT VALID TABLE "ci_stages" CONSTRAINT "fk_rails_5d4d96d44b_p" FOREIGN KEY = (partition_id, pipeline_id) REFERENCES p_ci_pipelines(partition_id, id) = ON UPDATE CASCADE ON DELETE CASCADE NOT VALID TABLE "ci_pipeline_messages" CONSTRAINT "fk_rails_8d3b04e3e1_p" = FOREIGN KEY (partition_id, pipeline_id) REFERENCES = p_ci_pipelines(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE TABLE "p_ci_pipelines_config" CONSTRAINT "fk_rails_906c9a2533_p" = FOREIGN KEY (partition_id, pipeline_id) REFERENCES = p_ci_pipelines(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE TABLE "ci_pipeline_artifacts" CONSTRAINT "fk_rails_a9e811a466_p" = FOREIGN KEY (partition_id, pipeline_id) REFERENCES = p_ci_pipelines(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE TABLE "p_ci_builds_execution_configs" CONSTRAINT = "fk_rails_c26408d02c_p" FOREIGN KEY (partition_id, pipeline_id) = REFERENCES p_ci_pipelines(partition_id, id) ON UPDATE CASCADE ON DELETE = CASCADE TABLE "ci_builds" CONSTRAINT "fk_rails_d739f46384_p" FOREIGN KEY = (partition_id, commit_id) REFERENCES p_ci_pipelines(partition_id, id) ON = UPDATE CASCADE ON DELETE CASCADE NOT VALID TABLE "gitlab_partitions_dynamic.ci_builds_101" CONSTRAINT = "fk_rails_d739f46384_p" FOREIGN KEY (partition_id, commit_id) REFERENCES = p_ci_pipelines(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE NOT = VALID TABLE "gitlab_partitions_dynamic.ci_builds_102" CONSTRAINT = "fk_rails_d739f46384_p" FOREIGN KEY (partition_id, commit_id) REFERENCES = p_ci_pipelines(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE NOT = VALID TABLE "gitlab_partitions_dynamic.ci_builds_execution_configs_102" = CONSTRAINT "fk_rails_e214655a86_p" FOREIGN KEY (partition_id, = pipeline_id) REFERENCES p_ci_pipelines(partition_id, id) ON UPDATE = CASCADE ON DELETE CASCADE NOT VALID TABLE "gitlab_partitions_dynamic.ci_builds_execution_configs_100" = CONSTRAINT "fk_rails_e214655a86_p" FOREIGN KEY (partition_id, = pipeline_id) REFERENCES p_ci_pipelines(partition_id, id) ON UPDATE = CASCADE ON DELETE CASCADE NOT VALID TABLE "gitlab_partitions_dynamic.ci_builds_execution_configs_101" = CONSTRAINT "fk_rails_e214655a86_p" FOREIGN KEY (partition_id, = pipeline_id) REFERENCES p_ci_pipelines(partition_id, id) ON UPDATE = CASCADE ON DELETE CASCADE NOT VALID TABLE "ci_daily_build_group_report_results" CONSTRAINT = "fk_rails_ee072d13b3_p" FOREIGN KEY (partition_id, last_pipeline_id) = REFERENCES p_ci_pipelines(partition_id, id) ON UPDATE CASCADE ON DELETE = CASCADE Triggers: p_ci_pipelines_loose_fk_trigger AFTER DELETE ON p_ci_pipelines = REFERENCING OLD TABLE AS old_table FOR EACH STATEMENT EXECUTE FUNCTION = insert_into_loose_foreign_keys_deleted_records() Partitions: ci_pipelines FOR VALUES IN ('100', '101', '102')