PostgreSQL without installation running in Windows but server not starting in CentOS Linux
I have downloaded the windows version of PostgreSQL from here: https://www.enterprisedb.com/products-services-training/pgbindownload
I unzipped it and I executed the commands below to run the server, and it worked in Windows 10:
D:postmaster_standalonepostgresql-11.0-2-windows-x64-binariespgsqlbin>initdb -D C:/Users/myuser/pgdataTest -U postgres -E UTF8
D:postmaster_standalonepostgresql-11.0-2-windows-x64-binariespgsqlbin>pg_ctl -D C:/Users/myuser/pgdataTest start
waiting for server to start....2018-11-20 23:06:37.912 IST [14540] LOG: listening on IPv6 address "::1", port 5432
2018-11-20 23:06:37.912 IST [14540] LOG: listening on IPv4 address "127.0.0.1", port 5432
2018-11-20 23:06:38.231 IST [11352] LOG: database system was shut down at 2018-11-20 23:05:02 IST
2018-11-20 23:06:38.385 IST [14540] LOG: database system is ready to accept connections
done
server started
D:postmaster_standalonepostgresql-11.0-2-windows-x64-binariespgsqlbin>psql -U postgres
psql (11.0)
WARNING: Console code page (437) differs from Windows code page (1252)
8-bit characters might not work correctly. See psql reference
page "Notes for Windows users" for details.
Type "help" for help.
postgres=#
In my CentOS , I checked with uname -m command
and it returns x86_64.
From the above link I downloaded the binaries for version 10.6 of Linux x86-64.
Then, I executed similar steps as in Windows in the below order, but the server is not starting:
[cloudera@quickstart bin]$ initdb -D /home/cloudera/pgdata -U postgres -E UTF8
The files belonging to this database system will be owned by user "cloudera".
This user must also own the server process.
-----
-----
The database cluster will be initialized with locale en_US.UTF-8.
Success. You can now start the database server using:
postgres -D /home/cloudera/pgdata
or
pg_ctl -D /home/cloudera/pgdata -l logfile start
[cloudera@quickstart bin]$ pg_ctl -D /home/cloudera/pgdata/ start
server starting
[cloudera@quickstart bin]$ 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"?
[cloudera@quickstart bin]$ psql -U postgres
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"?
Am I making any mistake? Kindly help.
postgresql
add a comment |
I have downloaded the windows version of PostgreSQL from here: https://www.enterprisedb.com/products-services-training/pgbindownload
I unzipped it and I executed the commands below to run the server, and it worked in Windows 10:
D:postmaster_standalonepostgresql-11.0-2-windows-x64-binariespgsqlbin>initdb -D C:/Users/myuser/pgdataTest -U postgres -E UTF8
D:postmaster_standalonepostgresql-11.0-2-windows-x64-binariespgsqlbin>pg_ctl -D C:/Users/myuser/pgdataTest start
waiting for server to start....2018-11-20 23:06:37.912 IST [14540] LOG: listening on IPv6 address "::1", port 5432
2018-11-20 23:06:37.912 IST [14540] LOG: listening on IPv4 address "127.0.0.1", port 5432
2018-11-20 23:06:38.231 IST [11352] LOG: database system was shut down at 2018-11-20 23:05:02 IST
2018-11-20 23:06:38.385 IST [14540] LOG: database system is ready to accept connections
done
server started
D:postmaster_standalonepostgresql-11.0-2-windows-x64-binariespgsqlbin>psql -U postgres
psql (11.0)
WARNING: Console code page (437) differs from Windows code page (1252)
8-bit characters might not work correctly. See psql reference
page "Notes for Windows users" for details.
Type "help" for help.
postgres=#
In my CentOS , I checked with uname -m command
and it returns x86_64.
From the above link I downloaded the binaries for version 10.6 of Linux x86-64.
Then, I executed similar steps as in Windows in the below order, but the server is not starting:
[cloudera@quickstart bin]$ initdb -D /home/cloudera/pgdata -U postgres -E UTF8
The files belonging to this database system will be owned by user "cloudera".
This user must also own the server process.
-----
-----
The database cluster will be initialized with locale en_US.UTF-8.
Success. You can now start the database server using:
postgres -D /home/cloudera/pgdata
or
pg_ctl -D /home/cloudera/pgdata -l logfile start
[cloudera@quickstart bin]$ pg_ctl -D /home/cloudera/pgdata/ start
server starting
[cloudera@quickstart bin]$ 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"?
[cloudera@quickstart bin]$ psql -U postgres
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"?
Am I making any mistake? Kindly help.
postgresql
add a comment |
I have downloaded the windows version of PostgreSQL from here: https://www.enterprisedb.com/products-services-training/pgbindownload
I unzipped it and I executed the commands below to run the server, and it worked in Windows 10:
D:postmaster_standalonepostgresql-11.0-2-windows-x64-binariespgsqlbin>initdb -D C:/Users/myuser/pgdataTest -U postgres -E UTF8
D:postmaster_standalonepostgresql-11.0-2-windows-x64-binariespgsqlbin>pg_ctl -D C:/Users/myuser/pgdataTest start
waiting for server to start....2018-11-20 23:06:37.912 IST [14540] LOG: listening on IPv6 address "::1", port 5432
2018-11-20 23:06:37.912 IST [14540] LOG: listening on IPv4 address "127.0.0.1", port 5432
2018-11-20 23:06:38.231 IST [11352] LOG: database system was shut down at 2018-11-20 23:05:02 IST
2018-11-20 23:06:38.385 IST [14540] LOG: database system is ready to accept connections
done
server started
D:postmaster_standalonepostgresql-11.0-2-windows-x64-binariespgsqlbin>psql -U postgres
psql (11.0)
WARNING: Console code page (437) differs from Windows code page (1252)
8-bit characters might not work correctly. See psql reference
page "Notes for Windows users" for details.
Type "help" for help.
postgres=#
In my CentOS , I checked with uname -m command
and it returns x86_64.
From the above link I downloaded the binaries for version 10.6 of Linux x86-64.
Then, I executed similar steps as in Windows in the below order, but the server is not starting:
[cloudera@quickstart bin]$ initdb -D /home/cloudera/pgdata -U postgres -E UTF8
The files belonging to this database system will be owned by user "cloudera".
This user must also own the server process.
-----
-----
The database cluster will be initialized with locale en_US.UTF-8.
Success. You can now start the database server using:
postgres -D /home/cloudera/pgdata
or
pg_ctl -D /home/cloudera/pgdata -l logfile start
[cloudera@quickstart bin]$ pg_ctl -D /home/cloudera/pgdata/ start
server starting
[cloudera@quickstart bin]$ 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"?
[cloudera@quickstart bin]$ psql -U postgres
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"?
Am I making any mistake? Kindly help.
postgresql
I have downloaded the windows version of PostgreSQL from here: https://www.enterprisedb.com/products-services-training/pgbindownload
I unzipped it and I executed the commands below to run the server, and it worked in Windows 10:
D:postmaster_standalonepostgresql-11.0-2-windows-x64-binariespgsqlbin>initdb -D C:/Users/myuser/pgdataTest -U postgres -E UTF8
D:postmaster_standalonepostgresql-11.0-2-windows-x64-binariespgsqlbin>pg_ctl -D C:/Users/myuser/pgdataTest start
waiting for server to start....2018-11-20 23:06:37.912 IST [14540] LOG: listening on IPv6 address "::1", port 5432
2018-11-20 23:06:37.912 IST [14540] LOG: listening on IPv4 address "127.0.0.1", port 5432
2018-11-20 23:06:38.231 IST [11352] LOG: database system was shut down at 2018-11-20 23:05:02 IST
2018-11-20 23:06:38.385 IST [14540] LOG: database system is ready to accept connections
done
server started
D:postmaster_standalonepostgresql-11.0-2-windows-x64-binariespgsqlbin>psql -U postgres
psql (11.0)
WARNING: Console code page (437) differs from Windows code page (1252)
8-bit characters might not work correctly. See psql reference
page "Notes for Windows users" for details.
Type "help" for help.
postgres=#
In my CentOS , I checked with uname -m command
and it returns x86_64.
From the above link I downloaded the binaries for version 10.6 of Linux x86-64.
Then, I executed similar steps as in Windows in the below order, but the server is not starting:
[cloudera@quickstart bin]$ initdb -D /home/cloudera/pgdata -U postgres -E UTF8
The files belonging to this database system will be owned by user "cloudera".
This user must also own the server process.
-----
-----
The database cluster will be initialized with locale en_US.UTF-8.
Success. You can now start the database server using:
postgres -D /home/cloudera/pgdata
or
pg_ctl -D /home/cloudera/pgdata -l logfile start
[cloudera@quickstart bin]$ pg_ctl -D /home/cloudera/pgdata/ start
server starting
[cloudera@quickstart bin]$ 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"?
[cloudera@quickstart bin]$ psql -U postgres
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"?
Am I making any mistake? Kindly help.
postgresql
postgresql
edited Nov 20 '18 at 21:08


Laurenz Albe
45.6k102748
45.6k102748
asked Nov 20 '18 at 17:51
A.G.Progm.EnthusiastA.G.Progm.Enthusiast
398217
398217
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
The PostgreSQL binary you are using must use a changed default value for unix_socket_directories
, and the user that starts the server doesn't have permissions to write there.
Either edit /home/cloudera/pgdata/postgresql.conf
and set
unix_socket_directories = /tmp
or start the server with
pg_ctl -D /home/cloudera/pgdata/ -o '-k /tmp' start
To connect, use
psql -h /tmp -U postgres -d postgres
It is still not working and failing with below error: I edited the postgresql.conf file as you suggested. Then ran below steps: [cloudera@quickstart bin]$ pg_ctl -D /home/cloudera/pgdata -o '-k /tmp' start server starting [cloudera@quickstart bin]$ psql -h /tmp psql: FATAL: database "cloudera" does not exist [cloudera@quickstart bin]$
– A.G.Progm.Enthusiast
Nov 21 '18 at 14:50
Then use the-U
and-d
options topsql
as indicated in my updated answer.
– Laurenz Albe
Nov 21 '18 at 18:14
It starts using -U and -d options to psql. But unlike windows while running pg_ctl it does not display host and port information as: listening on IPv4 address "127.0.0.1", port 5432 . So while connecting to the database through Perl I do not have the host and port information of the postgresql server. Thanks.
– A.G.Progm.Enthusiast
Nov 25 '18 at 17:23
Well, that's a completely different problem, right?
– Laurenz Albe
Nov 25 '18 at 18:24
Right, that's the reason I pasted the entire screen shots while running it from windows. I need to know the host and port number. otherwise it is difficult to work with it.
– A.G.Progm.Enthusiast
Nov 26 '18 at 3:48
|
show 6 more comments
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53398745%2fpostgresql-without-installation-running-in-windows-but-server-not-starting-in-ce%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
The PostgreSQL binary you are using must use a changed default value for unix_socket_directories
, and the user that starts the server doesn't have permissions to write there.
Either edit /home/cloudera/pgdata/postgresql.conf
and set
unix_socket_directories = /tmp
or start the server with
pg_ctl -D /home/cloudera/pgdata/ -o '-k /tmp' start
To connect, use
psql -h /tmp -U postgres -d postgres
It is still not working and failing with below error: I edited the postgresql.conf file as you suggested. Then ran below steps: [cloudera@quickstart bin]$ pg_ctl -D /home/cloudera/pgdata -o '-k /tmp' start server starting [cloudera@quickstart bin]$ psql -h /tmp psql: FATAL: database "cloudera" does not exist [cloudera@quickstart bin]$
– A.G.Progm.Enthusiast
Nov 21 '18 at 14:50
Then use the-U
and-d
options topsql
as indicated in my updated answer.
– Laurenz Albe
Nov 21 '18 at 18:14
It starts using -U and -d options to psql. But unlike windows while running pg_ctl it does not display host and port information as: listening on IPv4 address "127.0.0.1", port 5432 . So while connecting to the database through Perl I do not have the host and port information of the postgresql server. Thanks.
– A.G.Progm.Enthusiast
Nov 25 '18 at 17:23
Well, that's a completely different problem, right?
– Laurenz Albe
Nov 25 '18 at 18:24
Right, that's the reason I pasted the entire screen shots while running it from windows. I need to know the host and port number. otherwise it is difficult to work with it.
– A.G.Progm.Enthusiast
Nov 26 '18 at 3:48
|
show 6 more comments
The PostgreSQL binary you are using must use a changed default value for unix_socket_directories
, and the user that starts the server doesn't have permissions to write there.
Either edit /home/cloudera/pgdata/postgresql.conf
and set
unix_socket_directories = /tmp
or start the server with
pg_ctl -D /home/cloudera/pgdata/ -o '-k /tmp' start
To connect, use
psql -h /tmp -U postgres -d postgres
It is still not working and failing with below error: I edited the postgresql.conf file as you suggested. Then ran below steps: [cloudera@quickstart bin]$ pg_ctl -D /home/cloudera/pgdata -o '-k /tmp' start server starting [cloudera@quickstart bin]$ psql -h /tmp psql: FATAL: database "cloudera" does not exist [cloudera@quickstart bin]$
– A.G.Progm.Enthusiast
Nov 21 '18 at 14:50
Then use the-U
and-d
options topsql
as indicated in my updated answer.
– Laurenz Albe
Nov 21 '18 at 18:14
It starts using -U and -d options to psql. But unlike windows while running pg_ctl it does not display host and port information as: listening on IPv4 address "127.0.0.1", port 5432 . So while connecting to the database through Perl I do not have the host and port information of the postgresql server. Thanks.
– A.G.Progm.Enthusiast
Nov 25 '18 at 17:23
Well, that's a completely different problem, right?
– Laurenz Albe
Nov 25 '18 at 18:24
Right, that's the reason I pasted the entire screen shots while running it from windows. I need to know the host and port number. otherwise it is difficult to work with it.
– A.G.Progm.Enthusiast
Nov 26 '18 at 3:48
|
show 6 more comments
The PostgreSQL binary you are using must use a changed default value for unix_socket_directories
, and the user that starts the server doesn't have permissions to write there.
Either edit /home/cloudera/pgdata/postgresql.conf
and set
unix_socket_directories = /tmp
or start the server with
pg_ctl -D /home/cloudera/pgdata/ -o '-k /tmp' start
To connect, use
psql -h /tmp -U postgres -d postgres
The PostgreSQL binary you are using must use a changed default value for unix_socket_directories
, and the user that starts the server doesn't have permissions to write there.
Either edit /home/cloudera/pgdata/postgresql.conf
and set
unix_socket_directories = /tmp
or start the server with
pg_ctl -D /home/cloudera/pgdata/ -o '-k /tmp' start
To connect, use
psql -h /tmp -U postgres -d postgres
edited Nov 21 '18 at 18:14
answered Nov 20 '18 at 21:03


Laurenz AlbeLaurenz Albe
45.6k102748
45.6k102748
It is still not working and failing with below error: I edited the postgresql.conf file as you suggested. Then ran below steps: [cloudera@quickstart bin]$ pg_ctl -D /home/cloudera/pgdata -o '-k /tmp' start server starting [cloudera@quickstart bin]$ psql -h /tmp psql: FATAL: database "cloudera" does not exist [cloudera@quickstart bin]$
– A.G.Progm.Enthusiast
Nov 21 '18 at 14:50
Then use the-U
and-d
options topsql
as indicated in my updated answer.
– Laurenz Albe
Nov 21 '18 at 18:14
It starts using -U and -d options to psql. But unlike windows while running pg_ctl it does not display host and port information as: listening on IPv4 address "127.0.0.1", port 5432 . So while connecting to the database through Perl I do not have the host and port information of the postgresql server. Thanks.
– A.G.Progm.Enthusiast
Nov 25 '18 at 17:23
Well, that's a completely different problem, right?
– Laurenz Albe
Nov 25 '18 at 18:24
Right, that's the reason I pasted the entire screen shots while running it from windows. I need to know the host and port number. otherwise it is difficult to work with it.
– A.G.Progm.Enthusiast
Nov 26 '18 at 3:48
|
show 6 more comments
It is still not working and failing with below error: I edited the postgresql.conf file as you suggested. Then ran below steps: [cloudera@quickstart bin]$ pg_ctl -D /home/cloudera/pgdata -o '-k /tmp' start server starting [cloudera@quickstart bin]$ psql -h /tmp psql: FATAL: database "cloudera" does not exist [cloudera@quickstart bin]$
– A.G.Progm.Enthusiast
Nov 21 '18 at 14:50
Then use the-U
and-d
options topsql
as indicated in my updated answer.
– Laurenz Albe
Nov 21 '18 at 18:14
It starts using -U and -d options to psql. But unlike windows while running pg_ctl it does not display host and port information as: listening on IPv4 address "127.0.0.1", port 5432 . So while connecting to the database through Perl I do not have the host and port information of the postgresql server. Thanks.
– A.G.Progm.Enthusiast
Nov 25 '18 at 17:23
Well, that's a completely different problem, right?
– Laurenz Albe
Nov 25 '18 at 18:24
Right, that's the reason I pasted the entire screen shots while running it from windows. I need to know the host and port number. otherwise it is difficult to work with it.
– A.G.Progm.Enthusiast
Nov 26 '18 at 3:48
It is still not working and failing with below error: I edited the postgresql.conf file as you suggested. Then ran below steps: [cloudera@quickstart bin]$ pg_ctl -D /home/cloudera/pgdata -o '-k /tmp' start server starting [cloudera@quickstart bin]$ psql -h /tmp psql: FATAL: database "cloudera" does not exist [cloudera@quickstart bin]$
– A.G.Progm.Enthusiast
Nov 21 '18 at 14:50
It is still not working and failing with below error: I edited the postgresql.conf file as you suggested. Then ran below steps: [cloudera@quickstart bin]$ pg_ctl -D /home/cloudera/pgdata -o '-k /tmp' start server starting [cloudera@quickstart bin]$ psql -h /tmp psql: FATAL: database "cloudera" does not exist [cloudera@quickstart bin]$
– A.G.Progm.Enthusiast
Nov 21 '18 at 14:50
Then use the
-U
and -d
options to psql
as indicated in my updated answer.– Laurenz Albe
Nov 21 '18 at 18:14
Then use the
-U
and -d
options to psql
as indicated in my updated answer.– Laurenz Albe
Nov 21 '18 at 18:14
It starts using -U and -d options to psql. But unlike windows while running pg_ctl it does not display host and port information as: listening on IPv4 address "127.0.0.1", port 5432 . So while connecting to the database through Perl I do not have the host and port information of the postgresql server. Thanks.
– A.G.Progm.Enthusiast
Nov 25 '18 at 17:23
It starts using -U and -d options to psql. But unlike windows while running pg_ctl it does not display host and port information as: listening on IPv4 address "127.0.0.1", port 5432 . So while connecting to the database through Perl I do not have the host and port information of the postgresql server. Thanks.
– A.G.Progm.Enthusiast
Nov 25 '18 at 17:23
Well, that's a completely different problem, right?
– Laurenz Albe
Nov 25 '18 at 18:24
Well, that's a completely different problem, right?
– Laurenz Albe
Nov 25 '18 at 18:24
Right, that's the reason I pasted the entire screen shots while running it from windows. I need to know the host and port number. otherwise it is difficult to work with it.
– A.G.Progm.Enthusiast
Nov 26 '18 at 3:48
Right, that's the reason I pasted the entire screen shots while running it from windows. I need to know the host and port number. otherwise it is difficult to work with it.
– A.G.Progm.Enthusiast
Nov 26 '18 at 3:48
|
show 6 more comments
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53398745%2fpostgresql-without-installation-running-in-windows-but-server-not-starting-in-ce%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown