We got some internal feedback about the difficulties in cartodbfy'ing a
table. We also got some feedback telling us about the ambiguity of the
table creation need.
We want to make it clear and straightforward so that people don't find
roadblocks when following the examples.
Set the default copy_from_max_post_size to exactly 2 GB, as the nginx
limitation has been removed for that endpoint. So, the application is
now in control and this keeps the code clear and clean.
You may be wondering: why it checks for 1.99 GB but it says the limit is
at 2 GB? The actual hard-limit is set in nginx, but we want the app to
catch this error condition and report it properly to the client,
hence the 0.5 % license.
In order to give the DB quota middleware a chance of getting executed,
increase the 1 ms timeout to 10 ms. This is short but enough, as the
quota mocks are constant functions.
This is needed to make the setup a little bit more robust: when trying
to delete the test database, it won't be able if there are "idle
sessions" in the db (that is, connections from pgbouncer to the test
database).
Otherwise it fails when trying to create the database, because there's
already one with the same name.
This sends a PAUSE and RESUME to pgbouncer (in case there's one) before
and after executing tests, to make sure new connections are established
in the tests.
This may be especially important when role or session settings are
modified in the DB (same happens in prod, BTW).
pgbouncer does not support the `--client-min-messages` option. Actually
it fails connections if used like that with this somewhat cryptic
message:
```
psql: ERROR: Unsupported startup parameter: options
```
In order to be able to execute tests against pgbouncer port (which is
desirable IMO), we either need to remove that option (with little to no
impact) or change the lines above to choose the batch API port from the
config.
Mind that this affects just test setup.