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.1909300839100.26631@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,

>> Attached v18:
>>   - remove the test tablespace
>>     I had to work around a strange issue around partitioned tables and
>>     the default tablespace.
>
> - if (tablespace != NULL)
> + if (tablespace != NULL && strcmp(tablespace, "pg_default") != 0)
>
> [...]
>
> I don't think we need any such check, rather if the user gives
> default_tablespace with 'partitions' option, then let it fail with an
> error "cannot specify default tablespace for partitioned relations".

That is the one I wanted to avoid, which is triggered by TAP tests, but 
I'm fine with putting back a tablespace. Given partitioned table strange 
constraints, ISTM desirable to check that it works with options such as 
tablespace and fillfactor.

> (b) Create a non-default tablespace to test partitions with "all
> possible options" test as you have in your previous version.

> Also, add a comment explaining why in that test we are using non-default 
> tablespace.

> I am leaning towards approach (b) unless you and or Alvaro feels (a)
> is good for now or if you have some other idea.

No other idea. I put back the tablespace creation which I just removed, 
with comments about why it is there.

> If we want to go with option (b), I have small comment in your previous test:
> +# tablespace for testing
> +my $ts = $node->basedir . '/regress_pgbench_tap_1_ts_dir';
> +mkdir $ts or die "cannot create directory $ts";
> +my $ets = TestLib::perl2host($ts);
> +# add needed escaping!
> +$ets =~ s/'/''/;
>
> I am not sure if we really need this quote skipping stuff.  Why can't
> we write the test as below:
>
> # tablespace for testing
> my $basedir = $node->basedir;
> my $ts = "$basedir/regress_pgbench_tap_1_ts_dir";
> mkdir $ts or die "cannot create directory $ts";
> $ts = TestLib::perl2host($ts);
> $node->safe_psql('postgres',
>        "CREATE TABLESPACE regress_pgbench_tap_1_ts LOCATION '$ets';"

I think that this last command fails if the path contains a "'", so the 
'-escaping is necessary. I had to make changes in TAP tests before because 
it was not working when the path was a little bit strange, so now I'm 
careful.

Attached v19:
  - put back a local tablespace plus comments
  - remove the pg_default doubtful workaround.

-- 
Fabien.
Attachment

pgsql-hackers by date:

Previous
From: Alexey Kondratov
Date:
Subject: Re: Two pg_rewind patches (auto generate recovery conf and ensureclean shutdown)
Next
From: Magnus Hagander
Date:
Subject: Re: Usage of the system truststore for SSL certificate validation