Re: Simpler dump?

From: Ted Byers <r(dot)ted(dot)byers(at)rogers(dot)com>
To: Richard Huxton <dev(at)archonet(dot)com>
Cc: Tino Wildenhain <tino(at)wildenhain(dot)de>, "Uwe C(dot) Schroeder" <uwe(at)oss4u(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Simpler dump?
Date: 2007-12-10 16:24:24
Message-ID: 582388.94687.qm@web88304.mail.re4.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Thanks Richard.

--- Richard Huxton <dev(at)archonet(dot)com> wrote:

> Ted Byers wrote:
> > Amyway, when I look at the server using pgadmin, I
> > don't see either template0 or template1. I see
> only
> > template_postgis. Should I be able to see
> template0
> > and template1 among the databases on the server,
> or
> > are they normally hidden to minimise the chances
> of
> > getting them screwed up.
>
> There'll be an option in pgadmin somewhere to show
> them. Not sure where
> I'm afraid, I mostly use the command-line.
>
Found it. Under the "view" menu, the last item is
"System object". That now shows the template0 and
template1. It won't let me examine the contents of
template0, BUT ... It looks like template1 is a copy
of template_postgis. I see the same stuff in the two.

> > At this stage, how can I get a template I can use
> by
> > default that doesn't include the postgis stuff, so
> I
> > can use the template_postgis only when I need it?
>
> You can just drop template1 and re-create it using
> template0 (which is
> read-only) as it's template. Check the docs for
> CREATE DATABASE and
> google a little for examples.
>
OK. A worry. How is template_postgis constructed?
Is it just a handy reference to template1? Or does it
exist independantly? I don't want to be dropping
template1 only to find that breaking template_postgis.

A metaphore might explain the origin of my worry. I
use both C++ and Java. In C++, copy/assignment gives
you two different objects with the same data and
structure. Assignment in Java gives you two
references to the same object, so changes using the
one reference will be seen when examining the other
(this is a common gotcha for beginning developers
using both C++ and Java - the way to get C++
functionality inJava is to use operator new and the
class' copy constructor). So, in adding postgis
support, is the template_postgis creation more
analogous to assignment in C++ or to assignment in
Java?

Thanks

Ted

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Douglas McNaught 2007-12-10 16:26:41 Re: Simpler dump?
Previous Message Richard Huxton 2007-12-10 16:22:59 Re: Simpler dump?