Thread: How to copy database

How to copy database

From
Sudheesh Krishnankutty
Date:
Dear Admins,

I want to make a copy of an existing database.
How should I go about doing that. (Say I have an employee database
and I want to copy it to employee-release and employee-test.)

regards

Sudheesh

--
Sudheesh K
Software Engineer EDA
Softjin Infotech Pvt. Ltd.
No 227/70/A Sigma Arcade 1
Marathahalli
Airport Road,
Bangalore - 560037
Phone: 91-080-5234641/2 ext 206
Fax: 91-080-5234643
--------------------------------------------------------------------------------
This e-mail message and any files transmitted with it are intended solely for
the use of the individual or entity to which they are addressed. It may contain
confidential, proprietary or legally privileged information. If you are not the
intended  recipient please be advised that  you have  received this message in
error and any use is strictly prohibited. Please immediately delete it and all
copies of it from your system, destroy any hard copies of it and notify the
sender by return mail. You must not, directly or indirectly, use, disclose,
distribute, print, or copy any part of this message if you are not the intended
recipient.
------------------------------------------------------------------------------


Re: How to copy database

From
Aarni Ruuhimäki
Date:
Hi !

One way is to:

#pg_dump -c employee_db > employee_dump_c

then

#createdb employee_release

and

#cat employee_dump_c | psql employee_release

BR,

aarni

On Monday 17 February 2003 10:20 am, you wrote:
> Dear Admins,
>
> I want to make a copy of an existing database.
> How should I go about doing that. (Say I have an employee database
> and I want to copy it to employee-release and employee-test.)
>
> regards
>
> Sudheesh


Re: How to copy database

From
David C.Oshel
Date:
On Monday, February 17, 2003, at 02:24  AM, Aarni Ruuhimäki wrote:

> ...
> #cat employee_dump_c | psql employee_release
>

Or, for dog lovers:

$psql employee_release < employee_dump_c

Couldn't resist :-)
d

> BR,
>
> aarni
>
> On Monday 17 February 2003 10:20 am, you wrote:
>> Dear Admins,
>>
>> I want to make a copy of an existing database.
>> How should I go about doing that. (Say I have an employee database
>> and I want to copy it to employee-release and employee-test.)
>>
>> regards
>>
>> Sudheesh
>
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org
>
>
--
David C. Oshel               mailto:dcoshel@inav.net
Cedar Rapids, Iowa       http://soli.inav.net/~dcoshel
``Raffiniert ist der Herrgot, aber boshaft ist er nicht." - A. Einstein