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 1kZbux-000156-QU for pgsql-admin@arkaria.postgresql.org; Mon, 02 Nov 2020 15:38:47 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kZbuw-0000CE-HE for pgsql-admin@arkaria.postgresql.org; Mon, 02 Nov 2020 15:38:46 +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 1kZbuw-0000C7-7N for pgsql-admin@lists.postgresql.org; Mon, 02 Nov 2020 15:38:46 +0000 Received: from mail-qv1-xf2e.google.com ([2607:f8b0:4864:20::f2e]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kZbut-0004ZX-Lx for pgsql-admin@postgresql.org; Mon, 02 Nov 2020 15:38:45 +0000 Received: by mail-qv1-xf2e.google.com with SMTP id ed14so2717804qvb.4 for ; Mon, 02 Nov 2020 07:38:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=content-transfer-encoding:from:mime-version:subject:date:message-id :references:cc:in-reply-to:to; bh=mC0GgeWV+P5CQ9V4y978ipvId5PCDrMkd9JxhxB3Npw=; b=SDi9um3UR4+XwNXslO/20OyWNrse7/zZqJwnu/ZJo+gorZa5n0UEBI7UxE7D/d5O4Y lrA1dh9Zv703CoUvcKGLLly+nU7JVuR0Yuwgbb6vQH7SP6elMhAkVl5TyeZKFCYQbyyg wFtWvRLCD81s38VhJV0tv1UOjMW6sRlIz+eCMVrEfaxfQZCIvcizWgcJFx91fKkj+/dt QxMJgknMcVWIg48IpgIywWyIy3eSQMOFrrZBTAC13c8OTza+FJ0afvR5d68v9443oXbc VNthWbgAbxtYedmoh3EVFcHa+RgsZ7e78exZ5cNQQtd2uh75LIgilCgLXqsT5eebM06k y7HQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:content-transfer-encoding:from:mime-version :subject:date:message-id:references:cc:in-reply-to:to; bh=mC0GgeWV+P5CQ9V4y978ipvId5PCDrMkd9JxhxB3Npw=; b=I7RqvX2QBCyyUjEJcveQwR3iWNLSUJfmxAHG4Hmu428WS/h6/I/GQPexP+SvW8d80O skY+Vg83COHBFhBWBG2YXaryHJMVV8y6gmd8+nKaOA93oqjW0s9fLtz6IaRUOPj5S5J8 4JzjzhzrBNffiGOfvXZsuK0BubR4pKCDGMG3AhVbH4lgbU0mpkmPAer6F4PtYmVbZjbE LgSAZBVTGOoNQCsR8xKaze4yQeSEIMZIuoxQqcbw6g85a1WZPYUEsj38yaYCMYORCEMq fKBD793tD1cLd9dEe9v3Pm7S5hzK1s0dBo9zm6jTW+dlf9CbmuckCLuDl6jt/z5elhmS 3dFQ== X-Gm-Message-State: AOAM530WaQ+5gGFrXgSPCfG/z8suusOb7wHbvKotpP8SZZJ2h1hyOOc6 586ckDG1mydMoNsuh+RMAUfDfu3YkvyTtg== X-Google-Smtp-Source: ABdhPJxZLJ8H9cn1rNctBIzMQil7+VsXNnYHFgD1Td+1ixOggtatEm8xPFqUWC+ueN73Ea0wdfuzig== X-Received: by 2002:a0c:b48d:: with SMTP id c13mr22421034qve.13.1604331521685; Mon, 02 Nov 2020 07:38:41 -0800 (PST) Received: from [192.168.1.35] (cpe-71-72-37-104.neo.res.rr.com. [71.72.37.104]) by smtp.gmail.com with ESMTPSA id 185sm7107596qkm.113.2020.11.02.07.38.41 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 02 Nov 2020 07:38:41 -0800 (PST) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: John Scalia Mime-Version: 1.0 (1.0) Subject: Re: More on my partitioning problem Date: Mon, 2 Nov 2020 10:38:39 -0500 Message-Id: References: Cc: pgsql-admin In-Reply-To: To: Laurenz Albe X-Mailer: iPad Mail (18A8395) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Thank, Laurenz ( again ) don=E2=80=99t know why I didn=E2=80=99t think of th= at. =F0=9F=98=8E Sent from my iPad > On Nov 2, 2020, at 9:34 AM, Laurenz Albe wrote:= >=20 > =EF=BB=BFOn 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 P= RIMARY KEY USING INDEX, >> is not supported. So. being that I already have a unique index here, doe= s it >> really matter if I do not declare a primary key here? Otherwise, how woul= d I go >> about creating a primary key on this partitioned table? >=20 > Don't create a unique index and then use it to define a primary key constr= aint, > create the primary key directly: >=20 > ALTER TABLE part ADD PRIMARY KEY (id, part_key); >=20 > Yours, > Laurenz > --=20 > Cybertec | https://www.cybertec-postgresql.com >=20