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 1vE6PX-004z06-O5 for pgsql-general@arkaria.postgresql.org; Wed, 29 Oct 2025 13:40:23 +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 1vE6PW-001GfX-Dh for pgsql-general@arkaria.postgresql.org; Wed, 29 Oct 2025 13:40:21 +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 1vE6PW-001GfP-2r for pgsql-general@lists.postgresql.org; Wed, 29 Oct 2025 13:40:21 +0000 Received: from mail-pg1-x529.google.com ([2607:f8b0:4864:20::529]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vE6PT-004tN2-0f for pgsql-general@lists.postgresql.org; Wed, 29 Oct 2025 13:40:20 +0000 Received: by mail-pg1-x529.google.com with SMTP id 41be03b00d2f7-b6ce806af3eso6697719a12.0 for ; Wed, 29 Oct 2025 06:40:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1761745217; x=1762350017; darn=lists.postgresql.org; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=o46Wo7yjF6nDI/k/x8ajJ62xH1/fOhmMLwFjmDOnV3E=; b=KD6KOuoOcUGMWbgslSE4k8rE2sz4GUDHq8nwIX+4XgxbHf8O12RxI4oTW3DOR8tpnR tei3R9ckYaaf64UaZ4yJ0xKf6xv1HPTqRDrZSvUlPG01SXQ43m92zCj7PfKUX37mElvl kRzeIkBIqMnjd363N5/OvpK/vA7NF80fBu59U205jgd74ISBMpyseb6mVQNGZeh5vM1x c+MmSdakDjPR6o9gp8AGr88G6tlDHbXYz9rw0c+pYWUUP/eHEhpm0dhaOwExSzt2gPj2 GxMqiG1ybE4B6fKaqh7k23dyzWCjuWtO+5d+PM0EYwQrsWJUems222cVYT8Qqkr5alDt RJpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761745217; x=1762350017; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=o46Wo7yjF6nDI/k/x8ajJ62xH1/fOhmMLwFjmDOnV3E=; b=OrWlNfhmlgHGtwmCAoU8JhFJ+rI59qO/oPDrr48GeLssS9VkmfvBO8IgXSPvUNg3A/ qqppKEax+rVb+7cvpSAKAxRvN/rGkOh/5U7bPmoV62zcELKsV34OiA6Fy+F3uPmJcDjB PjFDPlTKAp6ZM0SVejnekOmd+PHRwz8ZXw54BeyOTzqoGMFq4lp4QA/JgYF9VCsLdRPA nmTXKBlSq5g9hXP9QjIcR2WLRHS0T8oIdbYu9oxq9sQ1yN9cSeqg6TpFCa8RRjLZc2nA ZEZj5z1ZrCeplUvEzbUQht7G1gkb9aRO0c1/ZRK3NksFsH77nKkXj6RgVF9JBR1NKVS0 2CSA== X-Gm-Message-State: AOJu0Yxvymkuq7ppX/m/A9DO/YYVREc+aeaYqeBAVFPJGmWD98plS3rK Mqbfg6mqA6Yw3LB1sB83AVRV27Dsh9ekwe2AqEHJdfUvrMpLbDFUAn05MFfictojiz/ddzeNMES N7vyjouJRt7ac22FX14KfYrul1QcJAUq57b8LqPE= X-Gm-Gg: ASbGncuoxG2Icvfux+2Ec59Pgw02CCtQPWW8zDH7yaYRIcrdrOZ3NreUVGII/Ax2fFR /+f9A3b/wj3CA5tJSkrJ0gvilwCyfKCGeo7hj6kVAF0QBtNBYd/u0Ydw7uJuGdxjHV+Adbh6dx3 pRNbH8H6ND8rOT+gyu6iI/zUGGuJnFXpLBY+PD8tNNUX+wYhSTB1fdp4M0IPP1JPsIuqNBFaR/w uEsXCUowUEp6S/H2Sk9RPWKvyarzzHxvzxfJ0pws3UjHuuFoSjWNMDqnwHoYcUQe2z1wrZpHepm jUoLb009qE82f1/BQkCnaT3gUVq4kCjSi+xeT78rVkLRb1vO9EWMS9JBvGx+QLERrfdWKL9YdZy QQJgJ0aWNk/g+7eLO5LAmFKxg6g== X-Google-Smtp-Source: AGHT+IGHTSd3nNghE8SAXje/xLSlK6pOJdQP5Cg5OCTeeNzDJHrM9K/hAx9VVPrLHNmqiqaSSRe0i+wuK+GlL3L6zEI= X-Received: by 2002:a17:902:968b:b0:28a:2e51:9272 with SMTP id d9443c01a7336-294def2d984mr30713885ad.48.1761745216819; Wed, 29 Oct 2025 06:40:16 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: "Colin 't Hart" Date: Wed, 29 Oct 2025 14:40:03 +0100 X-Gm-Features: AWmQ_bmzUNasa37gAdQj_aNxWE_110SuEXjAWlHS6Kb9B0fTYUBlgcdAsTv3esw Message-ID: Subject: Re: Two sequences associated with one identity column To: PostgreSQL General Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk As expected the dump contains: CREATE TABLE . ( , id bigint NOT NULL ); -- -- Name: ; Type: SEQUENCE; Schema: ; Owner: -- ALTER TABLE . ALTER COLUMN id ADD GENERATED ALWAYS AS IDENTITY ( SEQUENCE NAME . START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1 ); -- -- Name: ; Type: SEQUENCE; Schema: ; Owner: -- ALTER TABLE . ALTER COLUMN id ADD GENERATED ALWAYS AS IDENTITY ( SEQUENCE NAME . START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1 ); Two things are interesting: 1. The id column is last, so quite possibly added later (instead of the original PK which was dropped?) 2. The two sequences are just dumped -- which causes an error when importin= g. A third thing that is interesting is that I can drop the table just fine -- and both sequences get dropped along with it. The table seems to be relatively small -- and has no foreign keys -- so I think the solution will be to recreate the table (create table as select), drop the original table and finally rename the new table the same as the old one. Also checking to see if the problem extends to the other environments. /Colin On Wed, 29 Oct 2025 at 13:07, hubert depesz lubaczewski wrote: > > On Wed, Oct 29, 2025 at 01:04:48PM +0100, Colin 't Hart wrote: > > Thanks. But as I wrote above, trying to alter either of the two > > sequences and specifying "owned by none" results in the error. > > Sorry, missed that. > > Can you please provide pg_dump output from this db, just schema, just > this one table, and both sequences? > > Or, how did you arrive at this situation? > > Did you try to alter table =E2=80=A6 alter column =E2=80=A6 drop identity= ; > > Best regards, > > depesz >