Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kZavC-0006rL-3N for pgsql-admin@arkaria.postgresql.org; Mon, 02 Nov 2020 14:34:58 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kZavA-0003VE-QO for pgsql-admin@arkaria.postgresql.org; Mon, 02 Nov 2020 14:34:56 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kZavA-0003V7-D6 for pgsql-admin@lists.postgresql.org; Mon, 02 Nov 2020 14:34:56 +0000 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kZav7-0003v5-Km for pgsql-admin@postgresql.org; Mon, 02 Nov 2020 14:34:55 +0000 Received: by mail-wr1-x42a.google.com with SMTP id x7so14890584wrl.3 for ; Mon, 02 Nov 2020 06:34:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20150623.gappssmtp.com; s=20150623; h=message-id:subject:from:to:date:in-reply-to:references:user-agent :mime-version:content-transfer-encoding; bh=60BtC92ugiEXAdpmi7wdCVkLm9Q75cTSkh7rray5gp0=; b=iPJaj+VZiuvuq3TStoSrIGrtFpZ1ZQlu7uaREeSmvv4thQkggHhE7wY/L0FcogVfc4 yF/UFYHmPSdcA3dB16v1mIuhriAiTX7O9MxjgsgSmv9m4h0N+d24m6WZXjb6PKy3Ntm4 VJEg0GD2ThfG01VfbmVARGpCoAAgstVZBSxP7gV4XdvNihgtFqNHTCBbqFW8noP0xqu3 zoODMd4U7XXKY2KXENk5Maf7236Q30cGGjCJdYeuIub1kyuz0V/24Fd363ObSlAFCC6s dvrW9vCPyycSB1yPR09wPPVw4ys1YcIZDMv5N/h0ITLdlWx78q8ayURz2JbXge7CNJU4 9lSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=60BtC92ugiEXAdpmi7wdCVkLm9Q75cTSkh7rray5gp0=; b=EccodsM46la/5hNt73T8Epyv0rt1JKMSLV3BpZPmx/3lIo2TB3mqqbX8YLYxmewUgC Iq/nw9zebD22yWTksjf5xZjTv8FljLTFuhsdNZu6LyCtHqv0osapa11wltOb0A1xKu2y h9+Iq1uDrHK39TQeIYE9HIlkcZtfm9DtkjlvlbDGPmgVi4u3GQ1tsOTGmuIczVmwOo+D arXRgP0nGJT1BiMqVshOs8E0CZ6brKwxh4tp9hKNwyT1iLLzbzKoMNBpqkwPt/arD9jZ wN5Ea8lnA5tU23yyIDG7NISnyxk1mtkxhhfPBGgmLFaaH1a1lDDN6HDZs9kC6INL8yjN 4MIg== X-Gm-Message-State: AOAM531y/OnpxNtEf2Ca6/jlJbgBEgiKSg35GcuJLFDrAhYUE7j4Lk5T JdobV7aj8UIkLKcM5edSYbO+gw== X-Google-Smtp-Source: ABdhPJwy8wXWgHq0grgjPpg/TWla/ob2SO7EbC6n3Q4cJxHGWdCOkNS8wAnlPMvEW9AjizcY4e0yGg== X-Received: by 2002:adf:f6cc:: with SMTP id y12mr20739307wrp.107.1604327691029; Mon, 02 Nov 2020 06:34:51 -0800 (PST) Received: from localhost.localdomain ([212.186.219.234]) by smtp.gmail.com with ESMTPSA id t2sm5892431wrw.95.2020.11.02.06.34.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Nov 2020 06:34:50 -0800 (PST) Message-ID: Subject: Re: More on my partitioning problem From: Laurenz Albe To: John Scalia , pgsql-admin Date: Mon, 02 Nov 2020 15:34:49 +0100 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.5 (3.36.5-1.fc32) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Mon, 2020-11-02 at 07:40 -0500, John Scalia wrote: > I created a UNIQUE INDEX on the new base table using the original primary key > and the partitioning key. So far, so good. But doing an ALTER TABLE ADD PRIMARY KEY USING INDEX, > is not supported. So. being that I already have a unique index here, does it > really matter if I do not declare a primary key here? Otherwise, how would I go > about creating a primary key on this partitioned table? Don't create a unique index and then use it to define a primary key constraint, create the primary key directly: ALTER TABLE part ADD PRIMARY KEY (id, part_key); Yours, Laurenz -- Cybertec | https://www.cybertec-postgresql.com