Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

What does this mean?

468 views
Skip to first unread message

Mick

unread,
Nov 30, 2010, 10:40:31 PM11/30/10
to
I know PostgreSQL is installed and running as part of a TimeTrex install
but when I try to access it:

$ sudo psql
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.5432"?

I'm really looking to make a backup of the TimeTrac Database befor I
attempt an upgrade.

Suggestions?

Mladen Gogala

unread,
Dec 1, 2010, 12:45:35 PM12/1/10
to
On Tue, 30 Nov 2010 22:40:31 -0500, Mick wrote:

> $ sudo psql
> 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.5432"?
>
> I'm really looking to make a backup of the TimeTrac Database befor I
> attempt an upgrade.
>
> Suggestions?

Start the freaking PostgreSQL server.

--
http://mgogala.byethost5.com

Mick

unread,
Dec 1, 2010, 10:24:07 PM12/1/10
to
I note you cut my first line before posting your rudeness.

If TimeTrex is accessing it surely the server is already running.

If someone without experience in the area addressed asks for help or
advice. Either respond with help, advice or STFU.

Mladen Gogala

unread,
Dec 1, 2010, 11:23:53 PM12/1/10
to
On Wed, 01 Dec 2010 22:24:07 -0500, Mick wrote:

> If TimeTrex is accessing it surely the server is already running.

Your error says that it isn't running. You can prove me wrong by
verifying that the postgres processes are running, probably by
ps -fu postgres and by verifying that the shared memory is properly
attached by the postgres processes:


[root@lpo-postgres-01 ~]# ps -fu postgres
UID PID PPID C STIME TTY TIME CMD
postgres 5272 1 0 Nov30 ? 00:00:00 /usr/pgsql-9.0/bin/
postmaster -p
postgres 5274 5272 0 Nov30 ? 00:00:00 postgres: logger
process
postgres 5276 5272 0 Nov30 ? 00:00:02 postgres: writer
process
postgres 5277 5272 0 Nov30 ? 00:00:00 postgres: wal writer
process
postgres 5278 5272 0 Nov30 ? 00:00:00 postgres: autovacuum
launcher pr
postgres 5279 5272 0 Nov30 ? 00:00:00 postgres: stats collector
proces
[root@lpo-postgres-01 ~]#

[root@lpo-postgres-01 ~]# ipcs -m

------ Shared Memory Segments --------
key shmid owner perms bytes nattch
status
0x7402cf14 786432 root 600 4
0
0x7402ceea 1474561 root 600 4
0
0x0052e2c1 2555906 postgres 600 3310174208
4
0x7402cee9 1441795 root 600 4
0

[root@lpo-postgres-01 ~]#


Note the column nattch which will tell you the number of attached
processes. You can also verify that the server port is active:

nc -z -w 3 -v lpo-postgres-01 5432
Connection to lpo-postgres-01 5432 port [tcp/postgres] succeeded!

Here's what it looks like when it doesn't succeed:

[mgogala@medo ~]$ nc -z -w 3 -v localhost 5432
nc: connect to localhost port 5432 (tcp) failed: Connection refused

Your error tells you that the client process cannot establish contact on
the port 5432. If your (freaking) server is started, then you have messed
up the config file and did not enter the listener address. That's
probably the most frequent error made by beginners but, fortunately for
this group, most of those know how to use Google. Google is an excellent
resource and when you enter the first line of the error message, you will
get the following URL as the first result.

http://www.revsys.com/writings/postgresql/errors.html


There is a quite good explanation there. The Google search engine is
available at www.google.com. Many browsers also have a default field
pointing to Google. Try using it, it's not very hard. There is also a
good explanation of the Google search engine here:

http://www.google.com/support/websearch/bin/answer.py?hl=en&answer=134479

BTW, yes, I am having fun writing this.

--
http://mgogala.byethost5.com

Mick

unread,
Dec 2, 2010, 12:05:07 AM12/2/10
to

>
> BTW, yes, I am having fun writing this.
>

I'm sure you are
Let me explain my situation briefly

I never installed of configured the PostgreSQL server or client. I
assume that was done by the TimeTrex install.

When I go to upgrade to a later TimeTrex version to correct a couple of
issues they say "First back up your database".

I did not intend to become a Postres expert or DB admin I simply wanted
to back up my Db which timetrex accesses fine. Unfortunately their tech
support tends to answer in One-liners which blame everybody else except
their own people for any error.

Meanwhile their Db contains some payroll and Tax information that I
can't afford to lose without a lot of grief and hard work so I came to
the PGSQL experts hoping somebody would take sympathy on a finance man
who wants to use the system not become a Guru on it and explain in
simple terms what I could do.

So enjoy yourself and lets hope for you that the next time you seek
financial or any other advice in a field you are NOT an expert in. The
people you come in contact with treat you with greater respect.

Thomas Kellerer

unread,
Dec 2, 2010, 2:41:06 AM12/2/10
to
Mick, 01.12.2010 04:40:

> and accepting connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?

Is it accepting *domain socket* connections?

It seems the server is configured to only accept TCP/IP connection.

Try to specify a port when running psql, like

psql -p 5432 dbname username

You might also verify the environment variables for that user. If the PG... variables are defined (especially PGPORT and PGHOST), make sure they point to the correct hostname and database

http://www.postgresql.org/docs/current/static/libpq-envars.html


Regards
Thomas

Mladen Gogala

unread,
Dec 2, 2010, 7:32:01 AM12/2/10
to
On Thu, 02 Dec 2010 00:05:07 -0500, Mick wrote:

> I never installed of configured the PostgreSQL server or client. I
> assume that was done by the TimeTrex install.

There is such a thing as putting in a minimum effort.

>
> When I go to upgrade to a later TimeTrex version to correct a couple of
> issues they say "First back up your database".

Now, that takes exactly 10 minutes to learn.


>
> I did not intend to become a Postres expert or DB admin I simply wanted
> to back up my Db which timetrex accesses fine. Unfortunately their tech
> support tends to answer in One-liners which blame everybody else except
> their own people for any error.

If you are responsible for the database, you are the DB admin, whether
you like it or not. If you don't have a dedicated DBA is irrelevant.
You're it, you are responsible for the database, you might as well learn
how to use it and configure it properly. Also, a consultant may be an
option.


>
> Meanwhile their Db contains some payroll and Tax information that I
> can't afford to lose without a lot of grief and hard work so I came to
> the PGSQL experts hoping somebody would take sympathy on a finance man
> who wants to use the system not become a Guru on it and explain in
> simple terms what I could do.

You have a problem. You are responsible for a database that contains
financial information and you don't know how to use it properly. You
should get acquainted with the area of your responsibility. That will
require putting in some minimal effort.


>
> So enjoy yourself and lets hope for you that the next time you seek
> financial or any other advice in a field you are NOT an expert in. The
> people you come in contact with treat you with greater respect.

I was the only one who answered your question, so drop the attitude. You,
if I understand you correctly, are asking for a ready made answers,
without investing even a minimal effort, like using Google first. Your
attitude is not exactly the right one. Second, your question was badly
formulated because it doesn't contain either version or platform. Third,
there is a novice mailing list on postgresql.org.

--
http://mgogala.byethost5.com

Mick

unread,
Dec 2, 2010, 12:21:27 PM12/2/10
to
I am a finance man trying to use a tool. A carpenter sawing wood doesn't
expect to know how to design or rebuild a table saw!

I acknowledge that TimeTrex should provide better tools and
explanations/instructions however they don't and I dispair of getting
any meaningful support from them after weeks of trying. Yes I was hoping
someone would come up with some novice help suggestions but my workload
is sufficient that I don't intend at this time to give up sleep
completely to learn any technology.

Right now I'm simply looking to secure my data, hopefully so I can
import it to a better tool with better support.

So instead of constant criticism and telling me what MY job is, if you
are unwilling to help . . .

Mick

unread,
Dec 2, 2010, 12:33:27 PM12/2/10
to

Thanks,

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
password = f50ec5f9d
type = postgres8
user = timetrex

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.

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"?

How can I check if the Postgres install is in a standard location and
that TimeTrex have not done some wierd custom install?

Jasen Betts

unread,
Dec 2, 2010, 12:54:12 PM12/2/10
to

It 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


--
⚂⚃ 100% natural

Matthew Woodcraft

unread,
Dec 2, 2010, 1:43:23 PM12/2/10
to
Mick <mi...@nospam.net> wrote:
> 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
> password = f50ec5f9d
> type = postgres8
> user = timetrex

That helps.

I suggest trying
psql -h localhost -p 5433 timetrex timetrex

-M-

Mladen Gogala

unread,
Dec 2, 2010, 3:41:41 PM12/2/10
to
On Thu, 02 Dec 2010 12:21:27 -0500, Mick wrote:


> So instead of constant criticism and telling me what MY job is, if you
> are unwilling to help . . .

I gave you the answer. What seems to be the problem now? Have you tried
any of the commands I mentioned before? What is the result?

--
http://mgogala.byethost5.com

Mick

unread,
Dec 2, 2010, 8:48:05 PM12/2/10
to

Must be an ubuntu thing I still don't see why Synaptic does not see the
postgresql server as installed and running but using yhe password in the
timerex.php.ini file I got to this:


psql (8.4.5, server 8.3.3)
WARNING: psql version 8.4, server version 8.3.
Some psql features might not work.
Type "help" for help.

timetrex=# help
You are using psql, the command-line interface to PostgreSQL.
Type: \copyright for distribution terms
\h for help with SQL commands
\? for help with psql commands
\g or terminate with semicolon to execute query
\q to quit

so now reading the postgresql help sites should enable me to back up my
database.

I'm not even worrying about upgrading to the later server version
despite the above message since Ubuntu apparently doesn't know the
previous version is installed.

Many thanks for your patience and advice.

HoneyMonster

unread,
Dec 2, 2010, 9:32:29 PM12/2/10
to

You really are heading for a disaster. Why didn't you pay attention to
what Mladen was saying?

Mick

unread,
Dec 2, 2010, 10:50:20 PM12/2/10
to

What disaster would that be?


HoneyMonster

unread,
Dec 2, 2010, 11:38:14 PM12/2/10
to

You will lose your data.

Mick

unread,
Dec 2, 2010, 11:58:18 PM12/2/10
to

Nope Matthew gave me enough information to answer what was going wrong.
I was able to backup the database ( my original goal) and attempt the
timetrex upgrade which pretty much matched their track record and failed.

I was then able to revert to my previous version of Timetrex, restore my
database and everything recovered.

The missing localhost and port on the psql was the clue I needed.

I'm way too busy to be learning advanced postgresql administration when
the application I was using should take care of its own database.

The ability to back up my database however for other possible
eventualities is a great idea.

And I don't need people who know nothing about me or my business telling
me how to run my business.

Thanks for your concern though.

Mladen Gogala

unread,
Dec 3, 2010, 8:09:08 AM12/3/10
to
On Thu, 02 Dec 2010 23:58:18 -0500, Mick wrote:

> And I don't need people who know nothing about me or my business telling
> me how to run my business.

You misunderstood me. I am not trying to tell you how to run your
business, I know nothing about that. I am trying to tell you how to run
your database. That is, as John Hodgman has succinctly put it, my area of
expertize. Also, when asking questions on this group, please include
version, the platform you're using and do the preliminary Google search.
I wish you all the best with your business.

--
http://mgogala.byethost5.com

Mladen Gogala

unread,
Dec 9, 2010, 11:22:32 PM12/9/10
to
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 ~]$

--
http://mgogala.byethost5.com

Jasen Betts

unread,
Dec 10, 2010, 6:13:31 AM12/10/10
to
On 2010-12-10, Mladen Gogala <gogala...@gmail.com> wrote:
> 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

Only if it's listening on a TCP port on localhost
and you still have to figure out which one, nmap just lists the
corresponding name from /etc/services next to each number, it can't
determine which service it really is.

--
⚂⚃ 100% natural

Jasen Betts

unread,
Dec 10, 2010, 6:26:23 AM12/10/10
to
On 2010-12-02, Mick <mic...@verizon.net> wrote:

> 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.

> 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"

> 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

HoneyMonster

unread,
Dec 10, 2010, 7:57:04 AM12/10/10
to

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

0 new messages