Re: Feature request/suggestion - CREATE SCHEMA LIKE - Mailing list pgsql-general

From Joris Dobbelsteen
Subject Re: Feature request/suggestion - CREATE SCHEMA LIKE
Date
Msg-id 47DFB2BD.3080303@familiedobbelsteen.nl
Whole thread Raw
In response to Feature request/suggestion - CREATE SCHEMA LIKE  (wstrzalka <wstrzalka@gmail.com>)
Responses Re: Feature request/suggestion - CREATE SCHEMA LIKE  (Bruce Momjian <bruce@momjian.us>)
Re: Feature request/suggestion - CREATE SCHEMA LIKE  (Decibel! <decibel@decibel.org>)
List pgsql-general
wstrzalka wrote:
> Hi
>
>    Features like CREATE DATABASE WITH TEMPLATE or CREATE TABLE LIKE
> are very usefull but it would be great to have such a feature on the
> mid-level too. I mean something CREATE SCHEMA LIKE that would copy all
> the template schema relations, etc...
>  What do you think about it ? Would it be hard to implement ? Is it
> worth the effort
I believe the CREATE DATABASE was because of the way postgresql creates
a database. I thought it just copied the template database (but are not
completely sure). I also believe CREATE TABLE LIKE was mostly for
temporary tables, where the query can not be sure what the table
actually looks like when it is invoked.

Would it not be possible to work around the SCHEMA LIKE by just dumping
the database schema and restoring it to a new schema? This seems more
like a part that should be under strict user control and not automated
by common queries.

- Joris

pgsql-general by date:

Previous
From: "Albe Laurenz"
Date:
Subject: Re: Get index information from information_schema?
Next
From: Karsten Hilbert
Date:
Subject: Re: Problem with async notifications of table updates