pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: John Scalia <jayknowsunix@gmail.com>
To: Laurenz Albe <laurenz.albe@cybertec.at>
Cc: pgsql-admin <pgsql-admin@postgresql.org>
Subject: Re: More on my partitioning problem
Date: Mon, 2 Nov 2020 10:38:39 -0500
Message-ID: <F3E3A375-CF42-4EFD-8C89-151953481360@gmail.com> (raw)
In-Reply-To: <afa308100d47d0f9003225a8d39eae82786a7f1d.camel@cybertec.at>
References: <afa308100d47d0f9003225a8d39eae82786a7f1d.camel@cybertec.at>

Thank, Laurenz ( again ) don’t know why I didn’t think of that. 😎

Sent from my iPad

> On Nov 2, 2020, at 9:34 AM, Laurenz Albe <laurenz.albe@cybertec.at> wrote:
> 
> 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
> 





view thread (3+ messages)

Message-ID: <F3E3A375-CF42-4EFD-8C89-151953481360@gmail.com>
Permalink:  ../F3E3A375-CF42-4EFD-8C89-151953481360@gmail.com/
Also on:    postgresql.org/message-id/F3E3A375-CF42-4EFD-8C89-151953481360@gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: jayknowsunix@gmail.com, laurenz.albe@cybertec.at
  Subject: Re: More on my partitioning problem
  In-Reply-To: <F3E3A375-CF42-4EFD-8C89-151953481360@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox