Thread: Connecting to the database server

Connecting to the database server

From
LWATCDR
Date:
I think I got the data moved over from my old server. Now I am trying
to connect to the server with pgadminIII
I went into the postgers.conf and made these the changes I thought I
needed for me to log on and I did a restart but it is still telling me
that it can not connect.
Also I am getting a problem when I try to install the pg-DBD from yum.
I probably just need to go perl to install that I hope.

# - Connection Settings -

listen_addresses = '*'          # what IP address(es) to listen on;
                                        # comma-separated list of addresses;
                                        # defaults to 'localhost', '*' = all
                                        # (change requires restart)
port = 5432                             # (change requires restart)
max_connections = 100                   # (change requires restart)
# Note: increasing max_connections costs ~400 bytes of shared memory per
# connection slot, plus lock space (see max_locks_per_transaction).  You
# might also need to raise shared_buffers to support more connections.
#superuser_reserved_connections = 3     # (change requires restart)
#unix_socket_directory = ''             # (change requires restart)
#unix_socket_group = ''                 # (change requires restart)
unix_socket_permissions = 0777          # octal
                                        # (change requires restart)
#bonjour_name = ''                      # defaults to the computer name
                                        # (change requires restart)

# - Security & Authentication -

#authentication_timeout = 1min          # 1s-600s
#ssl = off                              # (change requires restart)
#password_encryption = on
#db_user_namespace = off

# Kerberos
#krb_server_keyfile = ''                # (change requires restart)
#krb_srvname = 'postgres'               # (change requires restart)
#krb_server_hostname = ''               # empty string matches any keytab entry
                                        # (change requires restart)
#krb_caseins_users = off                # (change requires restart)

# - TCP Keepalives -
# see 'man 7 tcp' for details

#tcp_keepalives_idle = 0                # TCP_KEEPIDLE, in seconds;
                                        # 0 selects the system default
#tcp_keepalives_interval = 0            # TCP_KEEPINTVL, in seconds;
                                        # 0 selects the system default
#tcp_keepalives_count = 0               # TCP_KEEPCNT;
                                        # 0 selects the system default

Re: Connecting to the database server

From
johnf
Date:
On Friday 11 January 2008 08:22:46 am LWATCDR wrote:
> I think I got the data moved over from my old server. Now I am trying
> to connect to the server with pgadminIII
> I went into the postgers.conf and made these the changes I thought I
> needed for me to log on and I did a restart but it is still telling me
> that it can not connect.
> Also I am getting a problem when I try to install the pg-DBD from yum.
> I probably just need to go perl to install that I hope.
>
> # - Connection Settings -
>
> listen_addresses = '*'          # what IP address(es) to listen on;
>                                         # comma-separated list of
> addresses; # defaults to 'localhost', '*' = all # (change requires restart)
> port = 5432                             # (change requires restart)
> max_connections = 100                   # (change requires restart) # Note:
> increasing max_connections costs ~400 bytes of shared memory per #
> connection slot, plus lock space (see max_locks_per_transaction).  You #
> might also need to raise shared_buffers to support more connections.
> #superuser_reserved_connections = 3     # (change requires restart)
> #unix_socket_directory = ''             # (change requires restart)
> #unix_socket_group = ''                 # (change requires restart)
> unix_socket_permissions = 0777          # octal
>                                         # (change requires restart)
> #bonjour_name = ''                      # defaults to the computer name
>                                         # (change requires restart)
>
> # - Security & Authentication -
>
> #authentication_timeout = 1min          # 1s-600s
> #ssl = off                              # (change requires restart)
> #password_encryption = on
> #db_user_namespace = off
>
> # Kerberos
> #krb_server_keyfile = ''                # (change requires restart)
> #krb_srvname = 'postgres'               # (change requires restart)
> #krb_server_hostname = ''               # empty string matches any keytab
> entry # (change requires restart) #krb_caseins_users = off                #
> (change requires restart)
>
> # - TCP Keepalives -
> # see 'man 7 tcp' for details
>
> #tcp_keepalives_idle = 0                # TCP_KEEPIDLE, in seconds;
>                                         # 0 selects the system default
> #tcp_keepalives_interval = 0            # TCP_KEEPINTVL, in seconds;
>                                         # 0 selects the system default
> #tcp_keepalives_count = 0               # TCP_KEEPCNT;
>                                         # 0 selects the system default
>
> ---------------------------(end of broadcast)---------------------------
> TIP 9: In versions below 8.0, the planner will ignore your desire to
>        choose an index scan if your joining column's datatypes do not
>        match

I'm no expert but I think your postgres.conf is just fine.  You should be
looking in pg_hba.conf

--
John Fabiani

Re: Connecting to the database server

From
LWATCDR
Date:
Thanks I did move on to pg_hba.conf but no joy yet.
I turned off ipchains since this box is inside our firewall and I am
just testing for now.
I added these lines to pg_hba.conf and restarted postgres
host    all         all         192.168.100.0/24       ident sameuser
host    phone       all         192.168.100.0/24       trust



I now get a message saying that the server terminated this connection
unexpectedly.
Any ideas?

On Jan 11, 2008 11:30 AM, johnf <jfabiani@yolo.com> wrote:
>
> On Friday 11 January 2008 08:22:46 am LWATCDR wrote:
> > I think I got the data moved over from my old server. Now I am trying
> > to connect to the server with pgadminIII
> > I went into the postgers.conf and made these the changes I thought I
> > needed for me to log on and I did a restart but it is still telling me
> > that it can not connect.
> > Also I am getting a problem when I try to install the pg-DBD from yum.
> > I probably just need to go perl to install that I hope.
> >
> > # - Connection Settings -
> >
> > listen_addresses = '*'          # what IP address(es) to listen on;
> >                                         # comma-separated list of
> > addresses; # defaults to 'localhost', '*' = all # (change requires restart)
> > port = 5432                             # (change requires restart)
> > max_connections = 100                   # (change requires restart) # Note:
> > increasing max_connections costs ~400 bytes of shared memory per #
> > connection slot, plus lock space (see max_locks_per_transaction).  You #
> > might also need to raise shared_buffers to support more connections.
> > #superuser_reserved_connections = 3     # (change requires restart)
> > #unix_socket_directory = ''             # (change requires restart)
> > #unix_socket_group = ''                 # (change requires restart)
> > unix_socket_permissions = 0777          # octal
> >                                         # (change requires restart)
> > #bonjour_name = ''                      # defaults to the computer name
> >                                         # (change requires restart)
> >
> > # - Security & Authentication -
> >
> > #authentication_timeout = 1min          # 1s-600s
> > #ssl = off                              # (change requires restart)
> > #password_encryption = on
> > #db_user_namespace = off
> >
> > # Kerberos
> > #krb_server_keyfile = ''                # (change requires restart)
> > #krb_srvname = 'postgres'               # (change requires restart)
> > #krb_server_hostname = ''               # empty string matches any keytab
> > entry # (change requires restart) #krb_caseins_users = off                #
> > (change requires restart)
> >
> > # - TCP Keepalives -
> > # see 'man 7 tcp' for details
> >
> > #tcp_keepalives_idle = 0                # TCP_KEEPIDLE, in seconds;
> >                                         # 0 selects the system default
> > #tcp_keepalives_interval = 0            # TCP_KEEPINTVL, in seconds;
> >                                         # 0 selects the system default
> > #tcp_keepalives_count = 0               # TCP_KEEPCNT;
> >                                         # 0 selects the system default
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 9: In versions below 8.0, the planner will ignore your desire to
> >        choose an index scan if your joining column's datatypes do not
> >        match
>
> I'm no expert but I think your postgres.conf is just fine.  You should be
> looking in pg_hba.conf
>
> --
> John Fabiani
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: explain analyze is your friend
>

Re: Connecting to the database server

From
"Andrej Ricnik-Bay"
Date:
On 12/01/2008, LWATCDR <lwatcdr@gmail.com> wrote:
> Thanks I did move on to pg_hba.conf but no joy yet.
> I turned off ipchains since this box is inside our firewall and I am
> just testing for now.
> I added these lines to pg_hba.conf and restarted postgres
> host    all         all         192.168.100.0/24       ident sameuser
> host    phone       all         192.168.100.0/24       trust
>
>
>
> I now get a message saying that the server terminated this connection
> unexpectedly.
> Any ideas?
I'd start at the *simple* end.  Can you connect from the
command line with psql?  What other lines have you got
in pg_hba.conf?

Sameuser only makes sense if a) the user account name is
the same for both the os and postgres and b) ident is actually
set-up and running.  Also, if you're working on the same machine
the IP stack will be trying to either use Unix sockets or the
loopback interface before trying the IP address.


Cheers,
Andrej

Re: Connecting to the database server

From
LWATCDR
Date:
Actually I was trying to connect to phone which was set to trust.
I got it working so thank you everybody.
BTW it takes a really long time to restore the data.... A really long time :)


On Jan 11, 2008 4:04 PM, Andrej Ricnik-Bay <andrej.groups@gmail.com> wrote:
> On 12/01/2008, LWATCDR <lwatcdr@gmail.com> wrote:
> > Thanks I did move on to pg_hba.conf but no joy yet.
> > I turned off ipchains since this box is inside our firewall and I am
> > just testing for now.
> > I added these lines to pg_hba.conf and restarted postgres
> > host    all         all         192.168.100.0/24       ident sameuser
> > host    phone       all         192.168.100.0/24       trust
> >
> >
> >
> > I now get a message saying that the server terminated this connection
> > unexpectedly.
> > Any ideas?
> I'd start at the *simple* end.  Can you connect from the
> command line with psql?  What other lines have you got
> in pg_hba.conf?
>
> Sameuser only makes sense if a) the user account name is
> the same for both the os and postgres and b) ident is actually
> set-up and running.  Also, if you're working on the same machine
> the IP stack will be trying to either use Unix sockets or the
> loopback interface before trying the IP address.
>
>
> Cheers,
> Andrej
>