Обсуждение: Copying a database

Поиск
Список
Период
Сортировка

Copying a database

От
Lawrence Moran
Дата:
Hi,

I have a simple, flat, empty database I'd like to use as a template for
others. How can I copy this template to start developing a new
database? Can it be done through phpPgAdmin?

Thanks,

Lawrence

Lawrence Moran
Research Associate
Department of Archaeology
University of York


Re: Copying a database

От
Sean Davis
Дата:
Lawrence,

Look at:

http://www.postgresql.org/docs/7.4/interactive/app-pgdump.html

In particular, use the --schema-only option.

Sean

On Jan 13, 2005, at 8:35 AM, Lawrence Moran wrote:

> Hi,
>
> I have a simple, flat, empty database I'd like to use as a template
> for others. How can I copy this template to start developing a new
> database? Can it be done through phpPgAdmin?
>
> Thanks,
>
> Lawrence
>
> Lawrence Moran
> Research Associate
> Department of Archaeology
> University of York
>
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>    (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)


Re: Copying a database

От
Michael Glaesemann
Дата:
On Jan 13, 2005, at 22:35, Lawrence Moran wrote:

> Hi,
>
> I have a simple, flat, empty database I'd like to use as a template
> for others. How can I copy this template to start developing a new
> database?

http://www.postgresql.org/docs/7.4/interactive/sql-createdatabase.html

See the TEMPLATE part.

> Can it be done through phpPgAdmin?

Not sure if there's a special utility to do so, but it's just straight
up SQL so you can enter it in the SQL section.

Hope that helps.


Michael Glaesemann
grzm myrealbox com


Re: Copying a database

От
Bruno Wolff III
Дата:
On Thu, Jan 13, 2005 at 13:35:57 +0000,
  Lawrence Moran <lm511@york.ac.uk> wrote:
> Hi,
>
> I have a simple, flat, empty database I'd like to use as a template for
> others. How can I copy this template to start developing a new
> database? Can it be done through phpPgAdmin?

When you run createdb you can specify an alternate template database using
the --template option.