Alvaro Herrera <alvherre@alvh.no-ip.org> writes:
> On 2021-Jun-23, Rumpi Gravenstein wrote:
>> As a best practice is it better to create the primary key starting or
>> ending with the partition column?
> It is not relevant from the partitioning point of view. Other factors
> can be used to decide the column order.
See in particular the hints in
https://www.postgresql.org/docs/current/indexes-multicolumn.html
The only thing that's different about partitioned situations is that
any particular child partition might have only a few values of the
partitioning column, which'd suggest putting it last if there are
no other relevant considerations. However, if you need a particular
column order to match query requirements, that's certainly going
to be a more important consideration.
regards, tom lane