Search Postgresql Archives

Re: copy/duplicate database schemas

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

 



On Wed, Jun 23, 2010 at 3:21 PM, Jamie Kahgee <jamie.kahgee@xxxxxxxxx> wrote:
> I have an application in a schema and now i need to create other schemas b/c
> the app needs to support different languages,  is there an easy way to copy
> an entire schema to a new one (tables, contents, trigges, functions, etc..)?
> right now i just have
>
> schema
>
> what I want is
>
> schema
> schema_ar
> schema_ru
> etc...

sure:
1) pg_dump -n your_schema -s
2) sed the resulting schema s/old_schema/new_schema
if you are lucky, you will have few if any improper replacements, if
not, tweak sed till it's right
3) cat it back into psql

merlin

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



[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