Discussion:
postgresql setup problem.
(too old to reply)
Johnny
2011-01-23 01:23:40 UTC
Permalink
Hello

I tried setting up the postgresql exactly as it says on the A0
specification.
Everything worked fine until when I tried running the

bash-3.00$ postmaster -p 1234 -D $HOME/pgdb
LOG: database system was shut down at 2011-01-22 20:04:20 EST
LOG: checkpoint record is at 0/390098
LOG: redo record is at 0/390098; undo record is at 0/0; shutdown TRUE
LOG: next transaction ID: 565; next OID: 10794
LOG: next MultiXactId: 1; next MultiXactOffset: 0
LOG: database system is ready
LOG: transaction ID wrap limit is 2147484146, limited by database
"postgres"

this part worked fine, but when I tried the next step on another window

bash-3.00$ createdb -p 1234 mytest
createdb: could not connect to database postgres: 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.1234"?

I tried this with many different port numbers, but the result was still the
same.

Can you please help me fix this?

Johnny
Pedram Ghodsnia
2011-01-23 06:14:52 UTC
Permalink
Post by Johnny
Hello
I tried setting up the postgresql exactly as it says on the A0
specification.
Everything worked fine until when I tried running the
bash-3.00$ postmaster -p 1234 -D $HOME/pgdb
LOG: database system was shut down at 2011-01-22 20:04:20 EST
LOG: checkpoint record is at 0/390098
LOG: redo record is at 0/390098; undo record is at 0/0; shutdown TRUE
LOG: next transaction ID: 565; next OID: 10794
LOG: next MultiXactId: 1; next MultiXactOffset: 0
LOG: database system is ready
LOG: transaction ID wrap limit is 2147484146, limited by database
"postgres"
this part worked fine, but when I tried the next step on another window
bash-3.00$ createdb -p 1234 mytest
createdb: could not connect to database postgres: 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.1234"?
I tried this with many different port numbers, but the result was still
the same.
Can you please help me fix this?
Johnny
Hi Johnny,

1- Do you log into the same machine in both windows? (use "hostname" to
make sure)
2- If you are using your own machine (not using your student account),
don't you have an active firewall on your system that may block the ports?
You can use "netstat -nap | grep 1234" to see if postmaster is listening
to the port 1234 in your second windows


Pedram
Johnny
2011-01-23 14:16:06 UTC
Permalink
I am using school machine, and both of the windows are on
linux006.student.cs.uwaterloo.ca

Johnny
Post by Pedram Ghodsnia
Post by Johnny
Hello
I tried setting up the postgresql exactly as it says on the A0
specification.
Everything worked fine until when I tried running the
bash-3.00$ postmaster -p 1234 -D $HOME/pgdb
LOG: database system was shut down at 2011-01-22 20:04:20 EST
LOG: checkpoint record is at 0/390098
LOG: redo record is at 0/390098; undo record is at 0/0; shutdown TRUE
LOG: next transaction ID: 565; next OID: 10794
LOG: next MultiXactId: 1; next MultiXactOffset: 0
LOG: database system is ready
LOG: transaction ID wrap limit is 2147484146, limited by database
"postgres"
this part worked fine, but when I tried the next step on another window
bash-3.00$ createdb -p 1234 mytest
createdb: could not connect to database postgres: 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.1234"?
I tried this with many different port numbers, but the result was still
the same.
Can you please help me fix this?
Johnny
Hi Johnny,
1- Do you log into the same machine in both windows? (use "hostname" to
make sure)
2- If you are using your own machine (not using your student account),
don't you have an active firewall on your system that may block the ports?
You can use "netstat -nap | grep 1234" to see if postmaster is listening
to the port 1234 in your second windows
Pedram
Pedram Ghodsnia
2011-01-23 17:33:16 UTC
Permalink
Please let me know the output of "netstat -nap | grep 1234".
replace "1234" with the port number that you are using.

Pedram
Post by Johnny
I am using school machine, and both of the windows are on
linux006.student.cs.uwaterloo.ca
Johnny
Post by Pedram Ghodsnia
Post by Johnny
Hello
I tried setting up the postgresql exactly as it says on the A0
specification.
Everything worked fine until when I tried running the
bash-3.00$ postmaster -p 1234 -D $HOME/pgdb
LOG: database system was shut down at 2011-01-22 20:04:20 EST
LOG: checkpoint record is at 0/390098
LOG: redo record is at 0/390098; undo record is at 0/0; shutdown TRUE
LOG: next transaction ID: 565; next OID: 10794
LOG: next MultiXactId: 1; next MultiXactOffset: 0
LOG: database system is ready
LOG: transaction ID wrap limit is 2147484146, limited by database
"postgres"
this part worked fine, but when I tried the next step on another window
bash-3.00$ createdb -p 1234 mytest
createdb: could not connect to database postgres: 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.1234"?
I tried this with many different port numbers, but the result was still
the same.
Can you please help me fix this?
Johnny
Hi Johnny,
1- Do you log into the same machine in both windows? (use "hostname"
to make sure)
2- If you are using your own machine (not using your student account),
don't you have an active firewall on your system that may block the ports?
You can use "netstat -nap | grep 1234" to see if postmaster is
listening to the port 1234 in your second windows
Pedram
Johnny
2011-01-23 18:14:05 UTC
Permalink
I'm using port 10004,

the output of the command was:

bash-3.00$ netstat -nap | grep 10004
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
tcp 0 0 127.0.0.1:10004 0.0.0.0:* LISTEN
3648/postmaster
unix 2 [ ACC ] STREAM LISTENING 4271905999 3648/postmaster
/tmp/.s.PGSQL.10004

It seems the port setup was done ok. maybe I'm missing some environment
variable missing?
I have set the PATH and LD_LIBRARY_PATH correctly. Do we need any other
environment variable be set?

Johnny
Post by Pedram Ghodsnia
Please let me know the output of "netstat -nap | grep 1234".
replace "1234" with the port number that you are using.
Pedram
Post by Johnny
I am using school machine, and both of the windows are on
linux006.student.cs.uwaterloo.ca
Johnny
Post by Pedram Ghodsnia
Post by Johnny
Hello
I tried setting up the postgresql exactly as it says on the A0
specification.
Everything worked fine until when I tried running the
bash-3.00$ postmaster -p 1234 -D $HOME/pgdb
LOG: database system was shut down at 2011-01-22 20:04:20 EST
LOG: checkpoint record is at 0/390098
LOG: redo record is at 0/390098; undo record is at 0/0; shutdown TRUE
LOG: next transaction ID: 565; next OID: 10794
LOG: next MultiXactId: 1; next MultiXactOffset: 0
LOG: database system is ready
LOG: transaction ID wrap limit is 2147484146, limited by database
"postgres"
this part worked fine, but when I tried the next step on another window
bash-3.00$ createdb -p 1234 mytest
createdb: could not connect to database postgres: 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.1234"?
I tried this with many different port numbers, but the result was still
the same.
Can you please help me fix this?
Johnny
Hi Johnny,
1- Do you log into the same machine in both windows? (use "hostname"
to make sure)
2- If you are using your own machine (not using your student account),
don't you have an active firewall on your system that may block the ports?
You can use "netstat -nap | grep 1234" to see if postmaster is
listening to the port 1234 in your second windows
Pedram
Pedram Ghodsnia
2011-01-23 20:09:55 UTC
Permalink
Hi Pedram!

actually the problem was the PATH variable, and once it was set
correctly, it works now!

thanks for your help!

Johnny



On Sun, Jan 23, 2011 at 2:37 PM, Pedram Ghodsnia
<***@cs.uwaterloo.ca> wrote:
Hi Johnny,

Are you sure that your environment variables are set correctly?
use "echo $PATH" to make sure.
Please send me the output of "echo $PATH".

Pedram
Post by Johnny
I'm using port 10004,
bash-3.00$ netstat -nap | grep 10004
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
tcp 0 0 127.0.0.1:10004 0.0.0.0:* LISTEN 3648/postmaster
unix 2 [ ACC ] STREAM LISTENING 4271905999 3648/postmaster
/tmp/.s.PGSQL.10004
It seems the port setup was done ok. maybe I'm missing some environment
variable missing?
I have set the PATH and LD_LIBRARY_PATH correctly. Do we need any other
environment variable be set?
Johnny
Post by Pedram Ghodsnia
Please let me know the output of "netstat -nap | grep 1234".
replace "1234" with the port number that you are using.
Pedram
Post by Johnny
I am using school machine, and both of the windows are on
linux006.student.cs.uwaterloo.ca
Johnny
Post by Pedram Ghodsnia
Post by Johnny
Hello
I tried setting up the postgresql exactly as it says on the A0
specification.
Everything worked fine until when I tried running the
bash-3.00$ postmaster -p 1234 -D $HOME/pgdb
LOG: database system was shut down at 2011-01-22 20:04:20 EST
LOG: checkpoint record is at 0/390098
LOG: redo record is at 0/390098; undo record is at 0/0; shutdown TRUE
LOG: next transaction ID: 565; next OID: 10794
LOG: next MultiXactId: 1; next MultiXactOffset: 0
LOG: database system is ready
LOG: transaction ID wrap limit is 2147484146, limited by database
"postgres"
this part worked fine, but when I tried the next step on another window
bash-3.00$ createdb -p 1234 mytest
createdb: could not connect to database postgres: 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.1234"?
I tried this with many different port numbers, but the result was still
the same.
Can you please help me fix this?
Johnny
Hi Johnny,
1- Do you log into the same machine in both windows? (use "hostname"
to make sure)
2- If you are using your own machine (not using your student account),
don't you have an active firewall on your system that may block the ports?
You can use "netstat -nap | grep 1234" to see if postmaster is
listening to the port 1234 in your second windows
Pedram
Loading...