Re: Unhappy thoughts about pg_dump and objects inherited from template1

From: Philip Warner <pjw(at)rhyme(dot)com(dot)au>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Jan Wieck <janwieck(at)Yahoo(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Unhappy thoughts about pg_dump and objects inherited from template1
Date: 2000-11-08 16:06:30
Message-ID: 3.0.5.32.20001109030630.02f09720@mail.rhyme.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

At 10:56 8/11/00 -0500, Tom Lane wrote:
>Philip Warner <pjw(at)rhyme(dot)com(dot)au> writes:
>> Just seems like we'd be forcing non-standard syntax on ourselves when/if
>> CREATE DATABASE becomes CREATE SCHEMA; I would assume that the two
>> statements would become synonymous?
>
>No, I don't think so --- we already have WITH LOCATION and WITH
>ENCODING, neither of which look like schema-level properties to me.

CREATE SCHEMA supports character set specification, so I'd guess 'WITH
ENCODING' will apply in some form. It also support a 'schema path name',
which may or may not map to locations.

>> Question: if I issue a "CREATE DATABASE foo WITH TEMPLATE 'my-favorite-db'"
>> will I just get a copy of the specified database, including data?
>
>If we allow it, that's what would happen. Seems like a potential
>security hole though ... should we restrict the set of clonable
>templates somehow?

It would be nice to have a 'supported' COPY DATABASE (which is what we're
talking about, really), so I'd vote for being able to use any DB as a
template, if possible.

Can we restrict the command to databases that have only one active backend?
Or add an 'istemplate' flag set in pg_database? I don't really like relying
on specific name formats, if we can avoid it.

----------------------------------------------------------------
Philip Warner | __---_____
Albatross Consulting Pty. Ltd. |----/ - \
(A.B.N. 75 008 659 498) | /(@) ______---_
Tel: (+61) 0500 83 82 81 | _________ \
Fax: (+61) 0500 83 82 82 | ___________ |
Http://www.rhyme.com.au | / \|
| --________--
PGP key available upon request, | /
and from pgp5.ai.mit.edu:11371 |/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ross J. Reedstrom 2000-11-08 16:07:44 Re: AW: Re: [GENERAL] Query caching
Previous Message Tom Lane 2000-11-08 15:56:23 Re: Unhappy thoughts about pg_dump and objects inherited from template1