Re: CREATE DATABASE Š [ TEMPLATE [=] template ] [ TABLESPACE [=] tablespace_name ]

From: Giuseppe Broccolo <giuseppe(dot)broccolo(at)2ndquadrant(dot)it>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: CREATE DATABASE Š [ TEMPLATE [=] template ] [ TABLESPACE [=] tablespace_name ]
Date: 2013-09-26 13:53:22
Message-ID: 52443C52.5050600@2ndquadrant.it
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Il 26/09/2013 13:27, Tim Kane ha scritto:
>
> I have a question regarding the behaviour of CREATE DATABASE when used
> with TEMPLATE and TABLESPACE options together.
>
>
> The documentation describes the tablespace parameter as:
>
> The name of the tablespace that will be associated with the new
> database, or DEFAULT to use the template database's tablespace.
> This tablespace will be the default tablespace used for objects
> created in this database. See CREATE TABLESPACE
> <http://www.postgresql.org/docs/9.3/static/sql-createtablespace.html> for
> more information.
>
>
> I would take that to mean that all objects from the template will be
> created in the new database within the specified tablespace.
This is possible setting the parameter 'default_tablespace':

SET default_tablespace = space1;

in this way, an implicit TABLESPACE clause is supplied in the objects
creation, independently it's done from a template or not.

Giuseppe.

--
Giuseppe Broccolo - 2ndQuadrant Italy
PostgreSQL Training, Services and Support
giuseppe(dot)broccolo(at)2ndQuadrant(dot)it | www.2ndQuadrant.it

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Merlin Moncure 2013-09-26 15:04:56 Re: postgres FDW doesn't support sequences?
Previous Message Kohler Manuel 2013-09-26 13:35:00 JDBC driver for Postgres 9.3