Re: Simple task with partitioning which I can't realize - Mailing list pgsql-performance

From David G. Johnston
Subject Re: Simple task with partitioning which I can't realize
Date
Msg-id CAKFQuwYkytWo+4qgV6unHCdbsgGN40yijoXrmOmJf=YeAawHpg@mail.gmail.com
Whole thread Raw
In response to RE: Simple task with partitioning which I can't realize  ("Andrew Zakharov" <Andrew898@mail.ru>)
List pgsql-performance
On Tue, Mar 1, 2022 at 9:37 AM Andrew Zakharov <Andrew898@mail.ru> wrote:

David, - yes, creation composite foreign/primary key is not a problem. But the main question is what method should I use for partitioning by composite key gid, region_code?


The convention here is to inline or bottom-post responses.

Your original plan - list partitions by region_code.  You couldn't do that before because you weren't seeing the region_code as being part of your PK and all partition columns must be part of the PK.  My suggestion is that instead of figuring out how to work around that limitation (not that I think there is a good one to be had) you accept it and just add region_code to the PK.

David J.

pgsql-performance by date:

Previous
From: "Andrew Zakharov"
Date:
Subject: RE: Simple task with partitioning which I can't realize
Next
From: "Andrew Zakharov"
Date:
Subject: RE: Simple task with partitioning which I can't realize