Re: pgbench - allow to create partitioned tables - Mailing list pgsql-hackers

From Fabien COELHO
Subject Re: pgbench - allow to create partitioned tables
Date
Msg-id alpine.DEB.2.21.1909240813280.5923@lancre
Whole thread Raw
In response to Re: pgbench - allow to create partitioned tables  (Amit Kapila <amit.kapila16@gmail.com>)
Responses Re: pgbench - allow to create partitioned tables
List pgsql-hackers
Hello Amit,

> {...]
> If you agree with this, then why haven't you changed below check in patch:
>
> + if (partition_method != PART_NONE)
> + printf("partition method: %s\npartitions: %d\n",
> +    PARTITION_METHOD[partition_method], partitions);
>
> This is exactly the thing bothering me.  It won't be easy for others
> to understand why this check for partitioning information is different
> from other checks.

As I tried to explain with an example, using "partitions > 0" does not 
work in this case because you can have a partitioned table with zero 
partitions attached while benchmarking, but this cannot happen while 
creating.

> For you or me, it might be okay as we have discussed this case, but it 
> won't be apparent to others.  This doesn't buy us much, so it is better 
> to keep this code consistent with other places that check for 
> partitions.

Attached uses "partition_method != PART_NONE" consistently, plus an assert 
on "partitions > 0" for checking and for triggering the default method at 
the end of option processing.

-- 
Fabien.
Attachment

pgsql-hackers by date:

Previous
From: Alexey Kondratov
Date:
Subject: Re: Allow CLUSTER, VACUUM FULL and REINDEX to change tablespace onthe fly
Next
From: Nikolay Shaplov
Date:
Subject: Re: [PATCH] src/test/modules/dummy_index -- way to test reloptions from inside of access method