Thread: pgsql-server: Move TablespaceCreateDbspace() call into smgrcreate(),

pgsql-server: Move TablespaceCreateDbspace() call into smgrcreate(),

From
tgl@svr1.postgresql.org (Tom Lane)
Date:
Log Message:
-----------
Move TablespaceCreateDbspace() call into smgrcreate(), which is where it
probably should have been to begin with; this is to cover cases like
needing to recreate the per-db directory during WAL replay.
Also, fix heap_create to force pg_class.reltablespace to be zero instead
of the database's default tablespace; this makes the world safe for
CREATE DATABASE to handle all tables in the default tablespace alike,
as per previous discussion.  And force pg_class.reltablespace to zero
when creating a relation without physical storage (eg, a view); this
avoids possibly having dangling references in this column after a
subsequent DROP TABLESPACE.

Modified Files:
--------------
    pgsql-server/src/backend/catalog:
        heap.c (r1.271 -> r1.272)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql-server/src/backend/catalog/heap.c.diff?r1=1.271&r2=1.272)
    pgsql-server/src/backend/commands:
        tablespace.c (r1.5 -> r1.6)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql-server/src/backend/commands/tablespace.c.diff?r1=1.5&r2=1.6)
    pgsql-server/src/backend/storage/smgr:
        smgr.c (r1.75 -> r1.76)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql-server/src/backend/storage/smgr/smgr.c.diff?r1=1.75&r2=1.76)
    pgsql-server/src/include/catalog:
        heap.h (r1.67 -> r1.68)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql-server/src/include/catalog/heap.h.diff?r1=1.67&r2=1.68)
    pgsql-server/src/include/commands:
        tablespace.h (r1.2 -> r1.3)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql-server/src/include/commands/tablespace.h.diff?r1=1.2&r2=1.3)