Re: copy/duplicate database schemas - Mailing list pgsql-general

From Craig Ringer
Subject Re: copy/duplicate database schemas
Date
Msg-id 4C22D12C.80904@postnewspapers.com.au
Whole thread Raw
In response to copy/duplicate database schemas  (Jamie Kahgee <jamie.kahgee@gmail.com>)
Responses Re: copy/duplicate database schemas  (Karsten Hilbert <Karsten.Hilbert@gmx.net>)
List pgsql-general
On 24/06/10 03:21, Jamie Kahgee 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..)?

Others have replied with suggestions on how to do this, so I won't
repeat that - but I think you need to look at the bigger picture.

If you copy your app into multiple schema then modify each to localize
them, you're going to have a maintenance nightmare on your hands if you
ever intend to fix bugs or add new features to your app. All the copies,
including copies in languages you don't speak, will have to be kept up
to date.

You might want to investigate internationalization options instead,
where you can process your "master" sources to produce a list of
strings, and have translators translate those strings. Your code loads
the string lists, and depending on the setting for the "current
language" decides which mapping of strings to translations to use when
emitting messages.

This adds significant complexity to your code, especially since (AFAIK)
there aren't really any good i18n tools for Pg's SQL, PL/PgSQL, etc.
However, it'll save you a LOT of pain not to maintain five (or more -
new translations are always required) versions of your code down the track.

--
Craig Ringer

pgsql-general by date:

Previous
From: "Joshua D. Drake"
Date:
Subject: Re: UPDATE after Cancle
Next
From: Konstantin Izmailov
Date:
Subject: Re: PQprepare in PostgreSQL 7.4 (lack of SAVEPOINTs)