Re: partitions vs indexes

2019-10-03 Thread Laurenz Albe
On Wed, 2019-10-02 at 22:09 +0200, Enrico Thierbach wrote: > would like to convert a table with a primary key into a partitioned > setup by a column which is not part of the primary key. Also, a > column might hold a referenece to a parent row. So this is my current > table setup, slimmed down: >

Re: partitions vs indexes

2019-10-03 Thread Enrico Thierbach
On 2 Oct 2019, at 22:16, Michael Lewis wrote: "I would like to convert a table with a primary key into a partitioned setup by a column which is not part of the primary key" That isn't possible. The partition key must be contained by the primary key. That is, the primary key could be site_id, i

Re: partitions vs indexes

2019-10-02 Thread Michael Lewis
"I would like to convert a table with a primary key into a partitioned setup by a column which is not part of the primary key" That isn't possible. The partition key must be contained by the primary key. That is, the primary key could be site_id, id and you can create hash partition on id or site_

Re: partitions vs indexes

2019-10-02 Thread Enrico Thierbach
On 2 Oct 2019, at 22:09, Enrico Thierbach wrote: Hello list, I run into some trouble with partitions: I would like to convert a table with a primary key into a partitioned setup by a column which is not part of the primary key. Also, a column might hold a referenece to a parent row. So this

partitions vs indexes

2019-10-02 Thread Enrico Thierbach
Hello list, I run into some trouble with partitions: I would like to convert a table with a primary key into a partitioned setup by a column which is not part of the primary key. Also, a column might hold a referenece to a parent row. So this is my current table setup, slimmed down: CR