Обсуждение: modo texto

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

modo texto

От
inf200468@ucf.edu.cu
Дата:

El servidor de postgres esta en windows, y quiero pasar una base de datos  a un servidor en linux con modo texto, segun voy entendiendo primero tengo que hacer pg_dump Base , a mi base de datos en windows, lo hago y no me muestra nada , no se si lo hizo o no , en caso de hacerlo genera algun fichero que no se donde esta
Gracias


Participe en Universidad 2010,
del 8 al 12 de febrero del 2010
La Habana, Cuba
http://www.universidad2010.cu
http://www.universidad2010.com

Re: modo texto

От
inf200468@ucf.edu.cu
Дата:
hi, sorry my english
I need to copy a data base from windows to linux, how can I save my data base from windows with pg_dump, and where the file is??????
and after how can I create the data base in linux without graphic enviroment , just text mode, with commands
Thank

> Olá,
>
> envia a tua pergunta em inglês.
>
> Joao
>
> faz assim:
>
> no Windows:
>
> pg_dumpall --clean -o myDumpFile.sql
>
> copia o myDumpFile.sql para o Ubuntu
>
> no Ubunto
>
> #sudo bash
> #su postgres
> #psql -f myDumpFile.sql postgres
>
>
>
>
> On Thu, 2009-05-28 at 10:57 -0400, inf200468@ucf.edu.cu wrote:
>> El servidor de postgres esta en windows, y quiero pasar una base de
>> datos a un servidor en linux con modo texto, segun voy entendiendo
>> primero tengo que hacer pg_dump Base , a mi base de datos en windows,
>> lo hago y no me muestra nada , no se si lo hizo o no , en caso de
>> hacerlo genera algun fichero que no se donde esta
>> Gracias
>>
>>
>> ______________________________________________________________________
>>
>> Participe en Universidad 2010,
>> del 8 al 12 de febrero del 2010
>> La Habana, Cuba
>> http://www.universidad2010.cu
>> http://www.universidad2010.com
>>
>


Participe en Universidad 2010,
del 8 al 12 de febrero del 2010
La Habana, Cuba
http://www.universidad2010.cu
http://www.universidad2010.com

Вложения

Re: modo texto

От
Grzegorz Jaśkiewicz
Дата:
On Thu, May 28, 2009 at 4:24 PM,  <inf200468@ucf.edu.cu> wrote:
> hi, sorry my english
> I need to copy a data base from windows to linux, how can I save my data
> base from windows with pg_dump, and where the file is??????
> and after how can I create the data base in linux without graphic enviroment
> , just text mode, with commands

yes, pg_dump is just the tool for it.

when you run pg_dump., you decide where the file is going to be
stored, by redirecting output to a file:

pg_dump database > C:\tmp\foo.sql


--
GJ

Re: modo texto

От
Joao Ferreira gmail
Дата:
On Thu, 2009-05-28 at 16:43 +0100, Grzegorz Jaśkiewicz wrote:
> On Thu, May 28, 2009 at 4:24 PM,  <inf200468@ucf.edu.cu> wrote:
> > hi, sorry my english
> > I need to copy a data base from windows to linux, how can I save my data
> > base from windows with pg_dump, and where the file is??????
> > and after how can I create the data base in linux without graphic enviroment
> > , just text mode, with commands
>
> yes, pg_dump is just the tool for it.
>
> when you run pg_dump., you decide where the file is going to be
> stored, by redirecting output to a file:
>
> pg_dump database > C:\tmp\foo.sql
>

take a look at:

a) the --clean option and also
b) pg_dumpall

depending on what exactly you have in hands these options would be
helpfull.

Joao


>
> --
> GJ
>


Re: modo texto

От
Craig Ringer
Дата:
inf200468@ucf.edu.cu wrote:

> I need to copy a data base from
> windows to linux, how can I save my data base from windows with pg_dump, and where the
> file is??????
> and after how can I create the data base in linux without graphic
> enviroment , just text mode, with commands

You might be more comfortable doing it with PgAdmin.

Use PgAdmin to connect to your Windows database and make a backup, then
connect to the database running on the Linux server and restore the backup.

To do this, you will have to edit the settings on the Linux server a
little. You will need to enable listening on TCP/IP on the Linux server
in postgresql.conf - look for the listen_addresses directive. You can
usually find postgresql.conf in /etc/postgresql , but it might be in
/etc/postgresql/8.3/main on machines where PostgreSQL is set up so
multiple versions can be installed at once.

You will need to create a database superuser with a password, or set the
a password for the postgres user. For example:

sudo -u postgres psql template1

CREATE USER dba SUPERUSER PASSWORD 'thepassword';

You might also have to edit pg_hba.conf to add an entry permitting
connections from the Windows machine. pg_hba.conf is either in your
PostgreSQL data directory or in the same place as postgresql.conf.

Once that's done, you can do most of your admin with PgAdmin from the
Windows box, though I *STRONGLY* recommend that you do learn to get
around the Linux box and the psql command line.

--
Craig Ringer