Can Postgres partition table by column values to enable partition pruning
In such a case having an index on country and city will probably perform much better than partitioning.
If you are really set on using partitioning, postgres always uses the CHECK constraints to prune partitions.
A way to approach this is to:

Create a function that based on the &quot;country&quot; &amp; &quot;city&quot; input will create a table that inherits from salesdata (if the table already exists return it)
If the table is newly created add a check constraint on the values of country &amp; city.
Create a trigger that executes before/after insert into salesdata that will run that function and insert into the country &amp; city partition.

When following this procedure and you do a select on SalesData postgres will prune the tables not matching the check constraint.