dbTalk Databases Forums  

What does this mean?

comp.databases.postgresql comp.databases.postgresql


Discuss What does this mean? in the comp.databases.postgresql forum.



Reply
 
Thread Tools Display Modes
  #21  
Old   
Jasen Betts
 
Posts: n/a

Default Re: What does this mean? - 12-10-2010 , 05:26 AM






On 2010-12-02, Mick <mickg01 (AT) verizon (DOT) net> wrote:

Quote:
I checked the timerex.php.ini file (One they said I should take extra
care to backup and the Databse sections has this:

[database]
database_name = timetrex
; type = postgres8
host = localhost:5433

Looking in Synaptic Package Manager it seems to say that the postgresql
client is running but not the server. So I'm still puzzled as to how
TimeTrex is accessing the database.
ah yep typical of a pg 8.4 install after 8.3 on debian or ubuntu
the pg_cluster subsystem has put the 8.4 on port 5433
this is debian wierdness, not standard postgres stuff.

Quote:
Could I safely install & run the Postgresql Server app without
destroying my database?

I tried running the command:
psql -p 543 timetrex timetrex
and still got:
psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5433"?
psql "host=localhost port=5433 user=timetrex password=f50ec5f9d"

Quote:
How can I check if the Postgres install is in a standard location and
that TimeTrex have not done some wierd custom install?
Run pg_lsclusters that'll show all the clusters (servers) and the
databases in each.

--
⚂⚃ 100% natural

Reply With Quote
  #22  
Old   
HoneyMonster
 
Posts: n/a

Default Re: What does this mean? - 12-10-2010 , 06:57 AM






On Fri, 10 Dec 2010 04:22:32 +0000, Mladen Gogala wrote:

Quote:
On Thu, 02 Dec 2010 17:54:12 +0000, Jasen Betts wrote:

t seems the database server isn't where psql expected it to be.
assuming TimeTrac (whatever that is) is functioning correctly I'd be
looking at its configuration for clues, or perhaps it has an inbuilt
database backup functionality?

on the other hand this might work better

sudo su postgres -- -c psql

If postgresql is not running on the default port, it is easy to figure
out which port is used:
mgogala@medo ~]$ nmap -sT -T5 localhost

Starting Nmap 5.21 ( http://nmap.org ) at 2010-12-09 23:15 EST Nmap scan
report for localhost (127.0.0.1) Host is up (0.00029s latency).
rDNS record for 127.0.0.1: localhost.localdomain Not shown: 996 closed
ports
PORT STATE SERVICE
22/tcp open ssh
80/tcp open http
631/tcp open ipp
5432/tcp open postgresql

Nmap done: 1 IP address (1 host up) scanned in 0.09 seconds

And here is a linux equivalent to tnsping:

[mgogala@medo ~]$ nc -z -w3 -v localhost 5432 Connection to localhost
5432 port [tcp/postgres] succeeded! [mgogala@medo ~]$ nc -z -w3 -v
localhost 1521 nc: connect to localhost port 1521 (tcp) failed:
Connection refused [mgogala@medo ~]$
PMJI. Useful tips. That's given me a little idea (error checking omitted
for simplicity):

#!/bin/bash
#
# pgping.sh - Test for postgres on a given host (TCP)

HOST=$1
PORT=`nmap -sT -T5 $HOST|grep postgresql|awk '{print $1}'|sed 's|/
tcp||'`

nc -z -w3 -v $HOST $PORT

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.