Re: Schema as versioning strategy

Поиск
Список
Период
Сортировка
От Jonathan Vanasco
Тема Re: Schema as versioning strategy
Дата
Msg-id F471D19C-BE79-40D3-94A5-8A87B6CE8997@2xlp.com
обсуждение исходный текст
Ответ на Re: Schema as versioning strategy  (Richard Huxton <dev@archonet.com>)
Список pgsql-general
On Apr 25, 2007, at 2:05 PM, Richard Huxton wrote:

> Owen Hartnett wrote:
>> I want to "freeze" a snapshot of the database every year (think of
>> end of year tax records).  However, I want this frozen version
>> (and all the previous frozen versions) available to the database
>> user as read-only.  My thinking is to copy the entire public
>> schema (which is where all the current data lives) into a new
>> schema, named 2007 (2008, etc.)
>
> Sounds perfectly reasonable. You could either do it as a series of:
>   CREATE TABLE archive2007.foo AS SELECT * FROM public.foo;
> or do a pg_dump of schema "public", tweak the file to change the
> schema names and restore it.

the create table method won't copy the constraints + fkeys .

i think you're best off with a pgdump


В списке pgsql-general по дате отправления:

Предыдущее
От: Ron Mayer
Дата:
Сообщение: Feature request - have postgresql log warning when new sub-release comes out.
Следующее
От: Shohab Abdullah
Дата:
Сообщение: PostgreSQL Performance Tuning