Re: Defining the same relation in another database

From: "Shoaib Mir" <shoaibmir(at)gmail(dot)com>
To: "Michael Talbot-Wilson" <mtw(at)view(dot)net(dot)au>
Cc: "Pgsql Novice Mailing List" <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Defining the same relation in another database
Date: 2006-04-19 08:17:04
Message-ID: bf54be870604190117m4e7257cbtdd88acaa5bd0a659@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Take the database dump using

pg_dump dbname > outfile

Now you can easily take out the DDL for relations and use them in another
database.

/Shoaib

On 4/19/06, Michael Talbot-Wilson <mtw(at)view(dot)net(dot)au> wrote:
>
> How do you do this? I guess it may require heroic methods such as the
> editing of dumps. Or it is easy?
>
> I'd like to do this because the \d is complicated. I've prototyped
> this thing in a temp database and now I'd like to do it for real. I'd
> rather not copy it down on paper and do it all again.
>
> It is okay to move the relation and its data, but I really just want
> to recreate it in another database.
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: explain analyze is your friend
>

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Guido Barosio 2006-04-19 08:55:04 Re: Defining the same relation in another database
Previous Message Tom Lane 2006-04-19 05:42:22 Re: Schema 'public'