Обсуждение: How to use the COPY command

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

How to use the COPY command

От
Low Kian Seong
Дата:
Dear people,

How do I use the copy command to copy a whole database
onto a system file so that i can use the createdb with
the -T flag to re-create the database on another
system ?

I have been searching around on the docs but it
doesn't explain much about this ?

Thank you in advance.



__________________________________
Do you Yahoo!?
Plan great trips with Yahoo! Travel: Now over 17,000 guides!
http://travel.yahoo.com/p-travelguide

Re: How to use the COPY command

От
Tom Lane
Дата:
Low Kian Seong <postgresql_low@yahoo.com> writes:
> How do I use the copy command to copy a whole database
> onto a system file so that i can use the createdb with
> the -T flag to re-create the database on another
> system ?

I think you are looking for pg_dump, not COPY.

            regards, tom lane

Re: How to use the COPY command

От
Low Kian Seong
Дата:
--- Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Low Kian Seong <postgresql_low@yahoo.com> writes:
> > How do I use the copy command to copy a whole
> database
> > onto a system file so that i can use the createdb
> with
> > the -T flag to re-create the database on another
> > system ?
>
> I think you are looking for pg_dump, not COPY.
>
>             regards, tom lane
>

When I use pg_dump, it complaints when i try to do
this :

createdb dbname -T /path/to/dump/file

What must the format of the dump file be in order for
the above command to work ?



__________________________________
Do you Yahoo!?
Yahoo! Mail - Helps protect you from nasty viruses.
http://promotions.yahoo.com/new_mail

Re: How to use the COPY command

От
Bruno Wolff III
Дата:
On Mon, Apr 18, 2005 at 23:48:38 -0700,
  Low Kian Seong <postgresql_low@yahoo.com> wrote:
>
> When I use pg_dump, it complaints when i try to do
> this :
>
> createdb dbname -T /path/to/dump/file

You don't use createdb to restore databases from dump files.
You use psql for text dumps and pg_restore for binary dumps.