Search Postgresql Archives

Re: Simpler dump?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thanks Richard.

--- Richard Huxton <dev@xxxxxxxxxxxx> 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

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux