Redgate Flyway

Tablespaces in PostgreSQL

What are tablespaces in PostgreSQL?

Tablespaces are a PostgreSQL feature that helps you manage where the data in your database is stored on disk. See the postgres documentation for more information.

Current functionality in Flyway

  • Flyway 11.20 and Flyway Desktop 8.7.5 adds advanced capabilities support for TABLESPACE properties on tables, indexes and materialized views. However the properties are filtered out by default, see below.

Known limitations

  • TABLESPACE objects themselves are not currently modeled, since these exist at the server level and in most cases their properties (e.g. paths on disk) will differ across environments.
  • The feature has not been tested in databases where the default tablespace is not pg_default . We would not recommend enabling tablespace support on databases where the setting has been changed.
  • The feature has not been tested on partitions. We would not recommend enabling tablespace support for your partitioned tables.

If you would like to enable TABLESPACE support but are blocked by the above or any other issues, please contact the development team.

How to include TABLESPACE properties in your Flyway project

Because many Flyway users use different tablespaces across environments, this functionality is disabled by default.  You can enable it by including the following in your filter.rgf file:

{
    "version": "1.2",
    "postFilters":
    [
      {
        // Include database object properties named "tablespace"
        "filterTarget": "property",
        "filterBy": "name",
        "filterValue": ["tablespace"],
        "effect": "include"
      }
    ]
}




Didn't find what you were looking for?