• Alvaro Herrera's avatar
    Fix tablespace handling for partitioned tables · ca410302
    Alvaro Herrera authored
    When partitioned tables were introduced, we failed to realize that by
    copying the tablespace handling for other relation kinds with no
    physical storage we were causing the secondary effect that their
    partitions would not automatically inherit the tablespace setting.  This
    is surprising and unhelpful, so change it to adopt the behavior
    introduced in pg11 (commit 33e6c34c3267) for partitioned indexes: the
    parent relation remembers the tablespace specification, which is then
    used for any new partitions that don't declare one.
    
    Because this commit changes behavior of the TABLESPACE clause for
    partitioned tables (it's no longer a no-op), it is not backpatched.
    
    Author: David Rowley, Álvaro Herrera
    Reviewed-by: Michael Paquier
    Discussion: https://postgr.es/m/CAKJS1f9SxVzqDrGD1teosFd6jBMM0UEaa14_8mRvcWE19Tu0hA@mail.gmail.com
    ca410302
tablespace.source 7.09 KB