Thread: Moving from Windows to Ubuntu - Have a couple of questions

Moving from Windows to Ubuntu - Have a couple of questions

From
Jennifer Trey
Date:
Hi,

I have been running PostgreSQL 8.3 for a while now and was installed through the standard Windows installer and everything has been working great :)

I am in the process of switching to Ubuntu, and I have a couple of question to get started. I installed pgadmin and postgre through the Synaptic Package Manager. I am unfamiliar with the console so I prefer to use pgAdmin to set things up.

Opening pgAdmin I see Servers(0) .. I am trying to add a server and filled out things to match the windows properties but can't get it to work. 
On the Service part, windows says postgresql-8.3 but on Ubuntu it is empty. I tried to put the same thing there as well, but also with no success. I am guessing I need to do something before that.. the ideas is that I will create a DB later and use my windows backup and restore.

Please help me figure this out,

Sincerely / Jennifer

Re: Moving from Windows to Ubuntu - Have a couple of questions

From
Andreas Wenk
Date:
Jennifer Trey schrieb:
> I am in the process of switching to Ubuntu, and I have a couple of
> question to get started. I installed pgadmin and postgre through the
> Synaptic Package Manager. I am unfamiliar with the console so I prefer
> to use pgAdmin to set things up.

congratulations for switching ;-). You should start to get familar with the console
because a lot of things are much easier using the console. Especially configuring the
PostgreSQL and using psql (the command line interface)

> Opening pgAdmin I see Servers(0) .. I am trying to add a server and
> filled out things to match the windows properties but can't get it to work.
> On the Service part, windows says postgresql-8.3 but on Ubuntu it is
> empty. I tried to put the same thing there as well, but also with no
> success. I am guessing I need to do something before that.. the ideas is
> that I will create a DB later and use my windows backup and restore.

You have to edit two files at least:

/etc/postgresql/8.3/main/pg_hba.conf

This ist the file for setting the authentication for your cluster. Please refer to this
part of the documentation:

http://www.postgresql.org/docs/8.3/interactive/auth-pg-hba-conf.html

And probably you also have to edit:

/etc/postgresql/8.3/main/postgresql.conf

Please read the documentation here:

http://www.postgresql.org/docs/8.3/interactive/runtime-config-connection.html

Most important is listen_adresses ... hm, I think the defaults should be ok to get started.

Basically you should be able to connect to the server by setting this in pg_hba.conf:

# TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD
local   all         all                               trust

But take care - this should only be set for testing purpose.

Is the server running? Type this in the command line:

$ /etc/init.d/postgresql-8.3 status

If you get something like this

8.3     main      5432 online postgres /var/lib/postgresql/8.3/main \
/var/log/postgresql/postgresql-8.3-main.log

PG is running ...

Hope that helps for the start

Cheers

Andy


Re: Moving from Windows to Ubuntu - Have a couple of questions

From
Jennifer Trey
Date:
Thanks, I got help from a friend and got it to work. I think postgre was running already but not sure what else he did.. i think that he altered the password among other things.

How should one port the config file from windows to linux? I am guessing replacing the .conf file is not an option :O .. the hard ware is the same, should I just go through them one after one?

- Jen

Re: Moving from Windows to Ubuntu - Have a couple of questions

From
Richard Huxton
Date:
Jennifer Trey wrote:
> Thanks, I got help from a friend and got it to work. I think postgre was
> running already but not sure what else he did.. i think that he altered the
> password among other things.

It might well have been the case that the "postgres" user didn't have a
password. Unix-based systems offer something called "ident" which may
well have been the default.

> How should one port the config file from windows to linux? I am guessing
> replacing the .conf file is not an option :O .. the hard ware is the same,
> should I just go through them one after one?

There shouldn't be that many differences - although, obviously any paths
will be different.

If you feel like learning some command-line stuff you could try:
  dos2unix /path/to/windows/postgresql.conf

  diff -b /path/to/windows/postgresql.conf
/path/to/ubuntu/postgresql/conf | less

That's two commands, each on a single line. The first one gives you unix
line-endings in the config file. The second finds differences (diff) and
feeds them to a scrollable file-viewer ("less", which is a sequel to
"more" because "less is more"). Use "q" to quit.

--
   Richard Huxton
   Archonet Ltd

Re: Moving from Windows to Ubuntu - Have a couple of questions

From
Jasen Betts
Date:
On 2009-07-28, Jennifer Trey <jennifer.trey@gmail.com> wrote:
> --001636c5a2d8cdcb9c046fc47cee
> Content-Type: text/plain; charset=ISO-8859-1
> Content-Transfer-Encoding: 7bit
>
> Hi,
> I have been running PostgreSQL 8.3 for a while now and was installed through
> the standard Windows installer and everything has been working great :)
>
> I am in the process of switching to Ubuntu, and I have a couple of question
> to get started. I installed pgadmin and postgre through the Synaptic Package
> Manager. I am unfamiliar with the console so I prefer to use pgAdmin to set
> things up.

One nice thing about the console is you can cut and paste to it,
Gui instructions tend to involve lots of reading descriptions fine
motor skills and and squinting at pictures.

> Opening pgAdmin I see Servers(0) .. I am trying to add a server and filled
> out things to match the windows properties but can't get it to work.
> On the Service part, windows says postgresql-8.3 but on Ubuntu it is empty.
> I tried to put the same thing there as well, but also with no success. I am
> guessing I need to do something before that.. the ideas is that I will
> create a DB later and use my windows backup and restore.

Postgres ships in most distributions with external network connections
turned off. one option is to install pgadmin on the ubuntu machine also.

The other is to turn on the networking, you probably only want to
enable (part of) your LAN.