CREATE TABLE LIKE and tablespaces - Mailing list pgsql-admin

From David F. Skoll
Subject CREATE TABLE LIKE and tablespaces
Date
Msg-id 20130227132935.44fc25f1@hydrogen.roaringpenguin.com
Whole thread Raw
Responses Re: CREATE TABLE LIKE and tablespaces  (Christian Ullrich <chris@chrullrich.net>)
List pgsql-admin
Hi,

I have an application that creates a daily table from a "prototype"
table, so something like:

CREATE TABLE data_20130226 LIKE data_prototype INCLUDING DEFAULTS INCLUDING CONSTRATINTS INCLUDING INDEXES;

It would be really nice to be able to add:

INCLUDING TABLESPACE

so that the daily table goes into the same table space as the prototype
table.  I can give a specific "TABLESPACE tablespace" clause, but then my
application needs to be aware that data_prototype is not in the default
tablespace.  Ideally, I'd like the admin to be able to move data_prototype
into an alternate tablespace and have all the daily tables be created
in that same tablespace.

I suppose similar comments apply to INHERITS.

Thoughts?

Regards,

David.



pgsql-admin by date:

Previous
From: John Rouillard
Date:
Subject: Re: logging full queries separately
Next
From: Daniel Paval
Date:
Subject: Data corruption / recover