in reply to Querying Postgres DB on Linux from Windows

You can use DBI to connect to a remote db -- just specify a dsn of something like dbi:Pg:host=192.168.123.123;port=5432;dbname=foo ... Note that the default post for postgres is 5432, but you must have it in your /usr/local/etc/pg_hba.conf file to allow outside connections. If you don't (or can't) have outside connections, you can get around it easily with a ssh tunnel (though it can be inconvenient).

You can also install the postgres odbc drivers so that you can connect from your windows box (e.g. using MS Access).

As for determining versions, uname -a and rpm -qa | grep redhat and rpm -qa | grep postgres and psql --version are good quick-and-dirty places to start...

Replies are listed 'Best First'.
Re^2: Querying Postgres DB on Linux from Windows
by bkiahg (Pilgrim) on Oct 03, 2005 at 21:16 UTC
    You're a wealth of knowledge my friend. These are the results of the above commands.
    [root@localhost root]# uname -a Linux localhost.localdomain 2.6.5-1.358smp #1 SMP Sat May 8 09:25:36 E +DT 2004 i686 i686 i386 GNU/Linux [root@localhost root]# rpm -qa | grep redhat redhat-artwork-0.96-1 redhat-rpm-config-8.0.28-1.1.1 redhat-menus-1.4.1-1 redhat-java-rpm-scripts-1.0.3-2 [root@localhost root]# rpm -qa | grep postgres postgresql-libs-7.4.2-1 postgresql-7.4.2-1 postgresql-server-7.4.2-1 [root@localhost root]# psql --version psql (PostgreSQL) 7.4.2 contains support for command-line editing
    A couple of questions for you, or anyone reading. How do I look up the name of the server? Is it localhost? /usr/local/etc/pg_hba.conf doesn't exist. What do I need to do to make sure I can access it from outside the box?

    If I could vote more than once I would for you. Excellent material. Thank you.
      i forgot this one, too: cat /etc/redhat-release

      name of the server: hostname
      or to get its ip address: /sbin/ifconfig
      note that 'localhost' (and 127.0.0.1) always points to yourself, so you wouldn't use it to access a remote server (unless you have a ssh tunnel)...

      does pg_hba.conf exist anywhere (locate pg_hba.conf)? Refer to the postgres docs on Client Authentication for more information.
        Found it in /usr/local/pgsql/data

        The only two lines not commented out are:
        trust local all all ident sameuser
        I think with the information supplied above I can figure it out. Thank you again for your generous help.