Thread: Create Public Schema

Create Public Schema

From
Date:
Hello all,<br /><br /> I'm trying to create a schema that contains the default tables, functions, etc. of the public
schema. Using pgAdmin, when I create a schema, it is blank - has no associated aggregates, tables, etc.  How would I
createadditional schems within a database that mirror the public schema.<br /><br /> Thanks....Rob<br /><br /> 

Re: Create Public Schema

From
Andreas Kretschmer
Date:
rsosnowski@cableone.net <rsosnowski@cableone.net> schrieb:

> Hello all,
> 
> I'm trying to create a schema that contains the default tables, functions,
> etc. of the public schema.  Using pgAdmin, when I create a schema, it is blank

1. make a dump from the public-schema
2. edit the dump and change 'public' to 'foobar' (the new schema-name)
3. restore the schema from dump

Now you have a exactly copy from 'public' with name 'foobar'.



HTH, Andreas
-- 
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect. (Linus Torvalds)
Kaufbach, Saxony, Germany, Europe.              N 51.05082°, E 13.56889°


Re: Create Public Schema

From
Mario Splivalo
Date:
On Sat, 2005-11-19 at 20:03 -0700, rsosnowski@cableone.net wrote:
> Hello all,
> 
> I'm trying to create a schema that contains the default tables,
> functions, etc. of the public schema.  Using pgAdmin, when I create a
> schema, it is blank - has no associated aggregates, tables, etc.  How
> would I create additional schems within a database that mirror the
> public schema.
> 

I guess your best bet would be to manually create all the scripts for
your database/schema objects. Use pg_dump to create a 'database schema
snapshot', and then use pg_restore -L to create scripts for objects you
desire.
Mike