On Tue, Sep 17, 2019 at 6:38 PM Fabien COELHO <coe...@cri.ensmp.fr> wrote: > > > >> It is used at one place where we can set PART_NONE without much loss. > >> Having lesser invalid values makes code easier to follow. > > > > Looking more closely at this case: > > + else if (PQntuples(res) != 1) > > + { > > + /* unsure because multiple (or no) pgbench_accounts found */ > > + partition_method = PART_UNKNOWN; > > + partitions = 0; > > + } > > > > Is it ever possible to have multiple pgbench_accounts considering we > > have unique index on (relname, relnamespace) for pg_class? > > The issue is that it is not directly obvious which relnamespace will be > used by the queries which rely on non schema qualified "pgbench_accounts". >
It seems to me the patch already uses namespace in the query, so this should not be a problem here. The part of query is as below: + res = PQexec(con, + "select p.partstrat, count(p.partrelid) " + "from pg_catalog.pg_class as c " This uses pg_catalog, so it should not have multiple entries for "pgbench_accounts". -- With Regards, Amit Kapila. EnterpriseDB: http://www.enterprisedb.com