pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: sivapostgres@yahoo.com <sivapostgres@yahoo.com>
To: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
To: Ray O'Donnell <ray@rodonnell.ie>
Subject: Re: Copy & Re-copy of DB
Date: Thu, 21 Jan 2021 13:52:35 +0000 (UTC)
Message-ID: <1829358841.3898628.1611237155653@mail.yahoo.com> (raw)
In-Reply-To: <00b51766-0fb1-6c6c-82c1-e08cf122e798@rodonnell.ie>
References: <1776022013.3890342.1611234824367.ref@mail.yahoo.com>
	<1776022013.3890342.1611234824367@mail.yahoo.com>
	<00b51766-0fb1-6c6c-82c1-e08cf122e798@rodonnell.ie>

 create database is to create a new database.  If we switch to new database, we need to change the new databasename in the program(s) that access this database.  
Is there any way to overwrite the data ?

    On Thursday, 21 January, 2021, 07:12:19 pm IST, Ray O'Donnell <ray@rodonnell.ie> wrote:  
 
 On 21/01/2021 13:13, sivapostgres@yahoo.com wrote:
> Hello,
> 
> I'm from SQL Server now developing my current project using PG.
> 
> In our earlier project(s), we used to copy the database from one server 
> to another, work in another server, and re-copy it in the original 
> server.   All happened easily with just transferring the two files (mdf 
> & ldf) to our required server.
> 
> Want to replicate the same in PG.  Is there any way to accomplish the 
> same in PG ?

create database <new-db-name> template <old-db-name>

Would that do the job? You could also use pg_dump.

Ray.


-- 
Raymond O'Donnell // Galway // Ireland
ray@rodonnell.ie


  

view thread (16+ messages)  latest in thread

Message-ID: <1829358841.3898628.1611237155653@mail.yahoo.com>
Permalink:  ../1829358841.3898628.1611237155653@mail.yahoo.com/
Also on:    postgresql.org/message-id/1829358841.3898628.1611237155653@mail.yahoo.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: sivapostgres@yahoo.com, ray@rodonnell.ie
  Subject: Re: Copy & Re-copy of DB
  In-Reply-To: <1829358841.3898628.1611237155653@mail.yahoo.com>
  References: <1776022013.3890342.1611234824367.ref@mail.yahoo.com> <1776022013.3890342.1611234824367@mail.yahoo.com> <00b51766-0fb1-6c6c-82c1-e08cf122e798@rodonnell.ie> <1829358841.3898628.1611237155653@mail.yahoo.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox