Could Not Connect To Server
<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div>
<div>Hello,</div>
<div> </div>
<div>I am running the following:</div>
<div>MacOS High Sierra 10.13.6</div>
<div>PostgreSQL 12.2</div>
<div>pgAdmin 4</div>
<div> </div>
<div>To see my qustion on Stack Overflow with picture:</div>
<div><a href="https://deref-mail.com/mail/client/0tUk0YweAhY/dereferrer/?redirectUrl=https%3A%2F%2Fstackoverflow.com%2Fquestions%2F61353989%2Fpgadmin-could-not-connect-to-server-connection-refused" target="_blank">https://stackoverflow.com/questions/61353989/pgadmin-could-not-connect-to-server-connection-refused</a></div>
<div> </div>
<div>
<p>I am trying to view databases with pgAdmin. After starting pgAdmin and successfully entering my "master password". I get the following error while trying to open up the only instance, in this case: "PostgeSQL 12".</p>
<p>I am getting this pgAdmin error:</p>
<p>"could not connect to server: Connection refused Is the server running on host "localhost" (::1) and accepting TCP/IP connections on port 5432? could not connect to server: Connection refused Is the server running on host "localhost" (127.0.0.1) and accepting TCP/IP connections on port 5432?"</p>
<p> </p>
<p>Trying to start the server, I navigate too: /Library/PostgreSQL/12/bin</p>
<p>from bin, I ran: sudo -u postgres ./pg_ctl start -D /Library/PostgreSQL/12/data</p>
<pre>pg_ctl: could not start server</pre>
<div> </div>
<div>When I ran the status command instead of start, it of course eluded to not running.</div>
<div>I mention all of this with the caveat that I did recently restore from a backup because I replaced my HDD with a SSD.</div>
<div> </div>
<div>Please advise,</div>
<div> </div>
<div>Thanks</div>
</div>
</div></div></body></html>
On Thu, Apr 23, 2020 at 11:18 AM Dummy Account <dummyaccount4u@mail.com>
wrote:
Trying to start the server, I navigate too: /Library/PostgreSQL/12/bin
from bin, I ran: sudo -u postgres ./pg_ctl start -D
/Library/PostgreSQL/12/datapg_ctl: could not start server
What do the logs say...
When I ran the status command instead of start, it of course eluded to not
running.
I mention all of this with the caveat that I did recently restore from a
backup because I replaced my HDD with a SSD.
You should be very specific as to how you restored your database from
backup because there is a good chance this wasn't done properly and you
presently have a corrupted database on your hard drive.
David J.
<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div> </div>
<div>
<div>The logs are listed on the stack overlow link.</div>
<div>But here they are:</div>
<div> </div>
<div>waiting for server to start....2020-04-22 15:57:51.766 CDT [5255] LOG: starting PostgreSQL 12.2 on x86_64-apple-darwin, compiled by Apple LLVM version 6.0 (clang-600.0.54) (based on LLVM 3.5svn), 64-bit<br/>
2020-04-22 15:57:51.766 CDT [5255] LOG: listening on IPv6 address "::", port 5432<br/>
2020-04-22 15:57:51.766 CDT [5255] LOG: listening on IPv4 address "0.0.0.0", port 5432<br/>
2020-04-22 15:57:51.768 CDT [5255] LOG: listening on Unix socket "/tmp/.s.PGSQL.5432"<br/>
2020-04-22 15:57:51.782 CDT [5255] LOG: redirecting log output to logging collector process<br/>
2020-04-22 15:57:51.782 CDT [5255] HINT: Future log output will appear in directory "log".<br/>
stopped waiting<br/>
pg_ctl: could not start server</div>
<div> </div>
<div>You might be misunderstanding where I said restore, I did not backup the database, I restored an Operating System because I changed out my hard drive for a solid state drive; therefore, I had to restore my Operating System from Time Machine/(backup).</div>
<div>
<div name="quote" style="margin:10px 5px 5px 10px; padding: 10px 0 10px 10px; border-left:2px solid #C3D9E5; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<div style="margin:0 0 10px 0;"><b>Sent:</b> Thursday, April 23, 2020 at 1:26 PM<br/>
<b>From:</b> "David G. Johnston" <david.g.johnston@gmail.com><br/>
<b>To:</b> "Dummy Account" <dummyaccount4u@mail.com><br/>
<b>Cc:</b> "pgsql-general" <pgsql-general@postgresql.org><br/>
<b>Subject:</b> Re: Could Not Connect To Server</div>
<div name="quoted-content">
<div>
<div>
<div class="gmail_default" style="font-family: arial , helvetica , sans-serif;"><span style="font-family: Arial , Helvetica , sans-serif;">On Thu, Apr 23, 2020 at 11:18 AM Dummy Account <<a href="mailto:dummyaccount4u@mail.com" onclick="parent.window.location.href='mailto:dummyaccount4u@mail.com'; return false;" target="_blank">dummyaccount4u@mail.com</a>> wrote:</span></div>
</div>
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin: 0.0px 0.0px 0.0px 0.8ex;border-left: 1.0px solid rgb(204,204,204);padding-left: 1.0ex;">
<div>
<div style="font-family: Verdana;font-size: 12.0px;">
<div> </div>
<div>
<p>Trying to start the server, I navigate too: /Library/PostgreSQL/12/bin</p>
<p>from bin, I ran: sudo -u postgres ./pg_ctl start -D /Library/PostgreSQL/12/data</p>
<pre>pg_ctl: could not start server</pre>
<div> </div>
</div>
</div>
</div>
</blockquote>
<div> </div>
<div>
<div class="gmail_default" style="font-family: arial , helvetica , sans-serif;">What do the logs say...</div>
</div>
<div> </div>
<blockquote class="gmail_quote" style="margin: 0.0px 0.0px 0.0px 0.8ex;border-left: 1.0px solid rgb(204,204,204);padding-left: 1.0ex;">
<div>
<div style="font-family: Verdana;font-size: 12.0px;">
<div>
<div>When I ran the status command instead of start, it of course eluded to not running.</div>
<div>I mention all of this with the caveat that I did recently restore from a backup because I replaced my HDD with a SSD.</div>
<div> </div>
</div>
</div>
</div>
</blockquote>
<div> </div>
<div class="gmail_default" style="font-family: arial , helvetica , sans-serif;">You should be very specific as to how you restored your database from backup because there is a good chance this wasn't done properly and you presently have a corrupted database on your hard drive.</div>
<div class="gmail_default" style="font-family: arial , helvetica , sans-serif;"> </div>
<div class="gmail_default" style="font-family: arial , helvetica , sans-serif;">David J.</div>
<div class="gmail_default" style="font-family: arial , helvetica , sans-serif;"> </div>
</div>
</div>
</div>
</div>
</div>
</div></div></body></html>
On Thu, Apr 23, 2020 at 11:48 AM Dummy Account <dummyaccount4u@mail.com>
wrote:
But here they are:
waiting for server to start....2020-04-22 15:57:51.766 CDT [5255] LOG:
starting PostgreSQL 12.2 on x86_64-apple-darwin, compiled by Apple LLVM
version 6.0 (clang-600.0.54) (based on LLVM 3.5svn), 64-bit
2020-04-22 15:57:51.766 CDT [5255] LOG: listening on IPv6 address "::",
port 5432
2020-04-22 15:57:51.766 CDT [5255] LOG: listening on IPv4 address
"0.0.0.0", port 5432
2020-04-22 15:57:51.768 CDT [5255] LOG: listening on Unix socket
"/tmp/.s.PGSQL.5432"
2020-04-22 15:57:51.782 CDT [5255] LOG: redirecting log output to logging
collector process
2020-04-22 15:57:51.782 CDT [5255] HINT: Future log output will appear in
directory "log".
And the relevant content from the log directory log file?
stopped waiting
pg_ctl: could not start server
You might be misunderstanding where I said restore, I did not backup the
database, I restored an Operating System because I changed out my hard
drive for a solid state drive; therefore, I had to restore my Operating
System from Time Machine/(backup).
And was that Time Machine backup made while the server was offline? If
not, and you didn't take any explicit steps to backup and restore the
database itself, then your database may be corrupted and thus unable to
boot. The log file should indicate whether that is the case.
David J.
<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div> </div>
<div>
<div>Hi David,</div>
<div> </div>
<div>When I backed-up, I don't know if the server was offline? I can say that I was not running pgAdmin. For instance, I backed up the Operating System and all of its applications. If I go run other application, including other servers, they work. As a matter of fact, if I boot into the old hard drive while it is outside of the laptop, it still works just as it did before I took it out of the laptop.</div>
<div> </div>
<div>As far as your question of "And the relevant content from the log directory log file?": what are you asking for? That <strong>is</strong> the entire and complete log after that command.</div>
<div> </div>
<div>Thanks, I appreciate the help.</div>
<div>
<div name="quote" style="margin:10px 5px 5px 10px; padding: 10px 0 10px 10px; border-left:2px solid #C3D9E5; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<div style="margin:0 0 10px 0;"><b>Sent:</b> Thursday, April 23, 2020 at 1:55 PM<br/>
<b>From:</b> "David G. Johnston" <david.g.johnston@gmail.com><br/>
<b>To:</b> "Dummy Account" <dummyaccount4u@mail.com><br/>
<b>Cc:</b> "pgsql-general" <pgsql-general@postgresql.org><br/>
<b>Subject:</b> Re: Could Not Connect To Server</div>
<div name="quoted-content">
<div>
<div>
<div class="gmail_default" style="font-family: arial , helvetica , sans-serif;"><span style="font-family: Arial , Helvetica , sans-serif;">On Thu, Apr 23, 2020 at 11:48 AM Dummy Account <<a href="mailto:dummyaccount4u@mail.com" onclick="parent.window.location.href='mailto:dummyaccount4u@mail.com'; return false;" target="_blank">dummyaccount4u@mail.com</a>> wrote:</span></div>
</div>
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin: 0.0px 0.0px 0.0px 0.8ex;border-left: 1.0px solid rgb(204,204,204);padding-left: 1.0ex;">
<div>
<div style="font-family: Verdana;font-size: 12.0px;">
<div>But here they are:</div>
</div>
</div>
</blockquote>
<blockquote class="gmail_quote" style="margin: 0.0px 0.0px 0.0px 0.8ex;border-left: 1.0px solid rgb(204,204,204);padding-left: 1.0ex;">
<div>
<div style="font-family: Verdana;font-size: 12.0px;">
<div> </div>
<div>waiting for server to start....2020-04-22 15:57:51.766 CDT [5255] LOG: starting PostgreSQL 12.2 on x86_64-apple-darwin, compiled by Apple LLVM version 6.0 (clang-600.0.54) (based on LLVM 3.5svn), 64-bit<br/>
2020-04-22 15:57:51.766 CDT [5255] LOG: listening on IPv6 address "::", port 5432<br/>
2020-04-22 15:57:51.766 CDT [5255] LOG: listening on IPv4 address "0.0.0.0", port 5432<br/>
2020-04-22 15:57:51.768 CDT [5255] LOG: listening on Unix socket "/tmp/.s.PGSQL.5432"<br/>
2020-04-22 15:57:51.782 CDT [5255] LOG: redirecting log output to logging collector process<br/>
2020-04-22 15:57:51.782 CDT [5255] HINT: Future log output will appear in directory "log".</div>
</div>
</div>
</blockquote>
<div> </div>
<div>
<div class="gmail_default" style="font-family: arial , helvetica , sans-serif;">And the relevant content from the log directory log file?</div>
</div>
<div> </div>
<blockquote class="gmail_quote" style="margin: 0.0px 0.0px 0.0px 0.8ex;border-left: 1.0px solid rgb(204,204,204);padding-left: 1.0ex;">
<div>
<div style="font-family: Verdana;font-size: 12.0px;">
<div> stopped waiting<br/>
pg_ctl: could not start server</div>
<div> </div>
<div>You might be misunderstanding where I said restore, I did not backup the database, I restored an Operating System because I changed out my hard drive for a solid state drive; therefore, I had to restore my Operating System from Time Machine/(backup).</div>
<div> </div>
</div>
</div>
</blockquote>
<div> </div>
<div class="gmail_default" style="font-family: arial , helvetica , sans-serif;">And was that Time Machine backup made while the server was offline? If not, and you didn't take any explicit steps to backup and restore the database itself, then your database may be corrupted and thus unable to boot. The log file should indicate whether that is the case.</div>
<div class="gmail_default" style="font-family: arial , helvetica , sans-serif;"> </div>
<div class="gmail_default" style="font-family: arial , helvetica , sans-serif;">David J.</div>
<div class="gmail_default" style="font-family: arial , helvetica , sans-serif;"> </div>
</div>
</div>
</div>
</div>
</div>
</div></div></body></html>
On 4/23/20 1:12 PM, Dummy Account wrote:
Hi David,
When I backed-up, I don't know if the server was offline? I can say
that I was not running pgAdmin. For instance, I backed up the
Operating System and all of its applications. If I go run other
application, including other servers, they work. As a matter of fact,
if I boot into the old hard drive while it is outside of the laptop,
it still works just as it did before I took it out of the laptop.
As far as your question of "And the relevant content from the log
directory log file?": what are you asking for? That *is* the entire
and complete log after that command.
Thanks, I appreciate the help.
*Sent:* Thursday, April 23, 2020 at 1:55 PM
*From:* "David G. Johnston" <david.g.johnston@gmail.com>
*To:* "Dummy Account" <dummyaccount4u@mail.com>
*Cc:* "pgsql-general" <pgsql-general@postgresql.org>
*Subject:* Re: Could Not Connect To Server
On Thu, Apr 23, 2020 at 11:48 AM Dummy Account
<dummyaccount4u@mail.com <mailto:dummyaccount4u@mail.com>> wrote:But here they are:
waiting for server to start....2020-04-22 15:57:51.766 CDT [5255]
LOG: starting PostgreSQL 12.2 on x86_64-apple-darwin, compiled by
Apple LLVM version 6.0 (clang-600.0.54) (based on LLVM 3.5svn), 64-bit
2020-04-22 15:57:51.766 CDT [5255] LOG: listening on IPv6 address
"::", port 5432
2020-04-22 15:57:51.766 CDT [5255] LOG: listening on IPv4 address
"0.0.0.0", port 5432
2020-04-22 15:57:51.768 CDT [5255] LOG: listening on Unix socket
"/tmp/.s.PGSQL.5432"
2020-04-22 15:57:51.782 CDT [5255] LOG: redirecting log output to
logging collector process
2020-04-22 15:57:51.782 CDT [5255] HINT: Future log output will
appear in directory "log".And the relevant content from the log directory log file?
stopped waiting
pg_ctl: could not start server
You might be misunderstanding where I said restore, I did not
backup the database, I restored an Operating System because I
changed out my hard drive for a solid state drive; therefore, I
had to restore my Operating System from Time Machine/(backup).And was that Time Machine backup made while the server was offline? If
not, and you didn't take any explicit steps to backup and restore the
database itself, then your database may be corrupted and thus unable
to boot. The log file should indicate whether that is the case.
David J.
I take it you're seeing that output in the Terminal shell window. What
value does -D get when you try to start postgres? Can we see the entire
command? The "log" directory will be within the value of -D I believe.
On 4/23/20 12:12 PM, Dummy Account wrote:
Hi David,
When I backed-up, I don't know if the server was offline? I can say
that I was not running pgAdmin. For instance, I backed up the Operating
System and all of its applications. If I go run other application,
including other servers, they work. As a matter of fact, if I boot into
the old hard drive while it is outside of the laptop, it still works
just as it did before I took it out of the laptop.
As far as your question of "And the relevant content from the log
directory log file?": what are you asking for? That *is* the entire and
complete log after that command.
Those are the messages sent to the screen. There are also messages sent
to the Postgres server log. Not sure where the OS X install puts that,
but I would start under /Library/PostgreSQL/12/data.
Thanks, I appreciate the help.
*Sent:* Thursday, April 23, 2020 at 1:55 PM
*From:* "David G. Johnston" <david.g.johnston@gmail.com>
*To:* "Dummy Account" <dummyaccount4u@mail.com>
*Cc:* "pgsql-general" <pgsql-general@postgresql.org>
*Subject:* Re: Could Not Connect To Server
On Thu, Apr 23, 2020 at 11:48 AM Dummy Account <dummyaccount4u@mail.com
<mailto:dummyaccount4u@mail.com>> wrote:But here they are:
waiting for server to start....2020-04-22 15:57:51.766 CDT [5255]
LOG: starting PostgreSQL 12.2 on x86_64-apple-darwin, compiled by
Apple LLVM version 6.0 (clang-600.0.54) (based on LLVM 3.5svn), 64-bit
2020-04-22 15:57:51.766 CDT [5255] LOG: listening on IPv6 address
"::", port 5432
2020-04-22 15:57:51.766 CDT [5255] LOG: listening on IPv4 address
"0.0.0.0", port 5432
2020-04-22 15:57:51.768 CDT [5255] LOG: listening on Unix socket
"/tmp/.s.PGSQL.5432"
2020-04-22 15:57:51.782 CDT [5255] LOG: redirecting log output to
logging collector process
2020-04-22 15:57:51.782 CDT [5255] HINT: Future log output will
appear in directory "log".And the relevant content from the log directory log file?
stopped waiting
pg_ctl: could not start server
You might be misunderstanding where I said restore, I did not backup
the database, I restored an Operating System because I changed out
my hard drive for a solid state drive; therefore, I had to restore
my Operating System from Time Machine/(backup).And was that Time Machine backup made while the server was offline? If
not, and you didn't take any explicit steps to backup and restore the
database itself, then your database may be corrupted and thus unable to
boot. The log file should indicate whether that is the case.
David J.
--
Adrian Klaver
adrian.klaver@aklaver.com
<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div> </div>
<div>
<div>Hey David,</div>
<div> </div>
<div>Can you tell me the exact name of the log file? Then I can search for it.</div>
<div> </div>
<div>Thanks</div>
<div>
<div name="quote" style="margin:10px 5px 5px 10px; padding: 10px 0 10px 10px; border-left:2px solid #C3D9E5; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<div style="margin:0 0 10px 0;"><b>Sent:</b> Thursday, April 23, 2020 at 2:25 PM<br/>
<b>From:</b> "Adrian Klaver" <adrian.klaver@aklaver.com><br/>
<b>To:</b> "Dummy Account" <dummyaccount4u@mail.com>, "David G. Johnston" <david.g.johnston@gmail.com><br/>
<b>Cc:</b> "pgsql-general" <pgsql-general@postgresql.org><br/>
<b>Subject:</b> Re: Could Not Connect To Server</div>
<div name="quoted-content">On 4/23/20 12:12 PM, Dummy Account wrote:<br/>
> Hi David,<br/>
> When I backed-up, I don't know if the server was offline? I can say<br/>
> that I was not running pgAdmin. For instance, I backed up the Operating<br/>
> System and all of its applications. If I go run other application,<br/>
> including other servers, they work. As a matter of fact, if I boot into<br/>
> the old hard drive while it is outside of the laptop, it still works<br/>
> just as it did before I took it out of the laptop.<br/>
> As far as your question of "And the relevant content from the log<br/>
> directory log file?": what are you asking for? That *is* the entire and<br/>
> complete log after that command.<br/>
<br/>
Those are the messages sent to the screen. There are also messages sent<br/>
to the Postgres server log. Not sure where the OS X install puts that,<br/>
but I would start under /Library/PostgreSQL/12/data.<br/>
<br/>
> Thanks, I appreciate the help.<br/>
> *Sent:* Thursday, April 23, 2020 at 1:55 PM<br/>
> *From:* "David G. Johnston" <david.g.johnston@gmail.com><br/>
> *To:* "Dummy Account" <dummyaccount4u@mail.com><br/>
> *Cc:* "pgsql-general" <pgsql-general@postgresql.org><br/>
> *Subject:* Re: Could Not Connect To Server<br/>
> On Thu, Apr 23, 2020 at 11:48 AM Dummy Account <dummyaccount4u@mail.com<br/>
> <mailto:dummyaccount4u@mail.com>> wrote:<br/>
><br/>
> But here they are:<br/>
><br/>
> waiting for server to start....2020-04-22 15:57:51.766 CDT [5255]<br/>
> LOG: starting PostgreSQL 12.2 on x86_64-apple-darwin, compiled by<br/>
> Apple LLVM version 6.0 (clang-600.0.54) (based on LLVM 3.5svn), 64-bit<br/>
> 2020-04-22 15:57:51.766 CDT [5255] LOG: listening on IPv6 address<br/>
> "::", port 5432<br/>
> 2020-04-22 15:57:51.766 CDT [5255] LOG: listening on IPv4 address<br/>
> "0.0.0.0", port 5432<br/>
> 2020-04-22 15:57:51.768 CDT [5255] LOG: listening on Unix socket<br/>
> "/tmp/.s.PGSQL.5432"<br/>
> 2020-04-22 15:57:51.782 CDT [5255] LOG: redirecting log output to<br/>
> logging collector process<br/>
> 2020-04-22 15:57:51.782 CDT [5255] HINT: Future log output will<br/>
> appear in directory "log".<br/>
><br/>
> And the relevant content from the log directory log file?<br/>
><br/>
> stopped waiting<br/>
> pg_ctl: could not start server<br/>
> You might be misunderstanding where I said restore, I did not backup<br/>
> the database, I restored an Operating System because I changed out<br/>
> my hard drive for a solid state drive; therefore, I had to restore<br/>
> my Operating System from Time Machine/(backup).<br/>
><br/>
> And was that Time Machine backup made while the server was offline? If<br/>
> not, and you didn't take any explicit steps to backup and restore the<br/>
> database itself, then your database may be corrupted and thus unable to<br/>
> boot. The log file should indicate whether that is the case.<br/>
> David J.<br/>
<br/>
<br/>
--<br/>
Adrian Klaver<br/>
adrian.klaver@aklaver.com</div>
</div>
</div>
</div></div></body></html>
On 4/23/20 1:32 PM, Dummy Account wrote:
Hey David,
Can you tell me the exact name of the log file? Then I can search for it.
Thanks
Apparently in your case it is called "log". I don't have version 12,
but version 9's start up name "pg_log" and that is the name of the file
in the data directory. Starting at /Library/PostgreSQL/12 as suggested
is a good bet
On 4/23/20 12:36 PM, Rob Sargent wrote:
On 4/23/20 1:32 PM, Dummy Account wrote:
Hey David,
Can you tell me the exact name of the log file? Then I can search for it.
ThanksApparently in your case it is called "log". I don't have version 12,
To be clear 'log' is the name of the directory that holds the logs. The
log files themselves are named according to some pattern generally. The
default is:
https://www.postgresql.org/docs/12/runtime-config-logging.html#RUNTIME-CONFIG-LOGGING-WHERE
log_filename
The default is postgresql-%Y-%m-%d_%H%M%S.log
but version 9's start up name "pg_log" and that is the name of the file
in the data directory. Starting at /Library/PostgreSQL/12 as suggested
is a good bet
--
Adrian Klaver
adrian.klaver@aklaver.com
<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div> </div>
<div>
<div>Hey Everyone,</div>
<div> </div>
<div>I did find loggin.h and insallation_summary.log. Neither of which look to include the info you may want.</div>
<div> </div>
<div>Please advise as to what log file you want to see.</div>
<div> </div>
<div>Thanks</div>
<div>
<div name="quote" style="margin:10px 5px 5px 10px; padding: 10px 0 10px 10px; border-left:2px solid #C3D9E5; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<div style="margin:0 0 10px 0;"><b>Sent:</b> Thursday, April 23, 2020 at 2:32 PM<br/>
<b>From:</b> "Dummy Account" <dummyaccount4u@mail.com><br/>
<b>To:</b> "Adrian Klaver" <adrian.klaver@aklaver.com><br/>
<b>Cc:</b> "David G. Johnston" <david.g.johnston@gmail.com>, "pgsql-general" <pgsql-general@postgresql.org><br/>
<b>Subject:</b> Re: Could Not Connect To Server</div>
<div name="quoted-content">
<div style="font-family: Verdana;font-size: 12.0px;">
<div> </div>
<div>
<div>Hey David,</div>
<div> </div>
<div>Can you tell me the exact name of the log file? Then I can search for it.</div>
<div> </div>
<div>Thanks</div>
<div>
<div style="margin: 10.0px 5.0px 5.0px 10.0px;padding: 10.0px 0 10.0px 10.0px;border-left: 2.0px solid rgb(195,217,229);">
<div style="margin: 0 0 10.0px 0;"><b>Sent:</b> Thursday, April 23, 2020 at 2:25 PM<br/>
<b>From:</b> "Adrian Klaver" <adrian.klaver@aklaver.com><br/>
<b>To:</b> "Dummy Account" <dummyaccount4u@mail.com>, "David G. Johnston" <david.g.johnston@gmail.com><br/>
<b>Cc:</b> "pgsql-general" <pgsql-general@postgresql.org><br/>
<b>Subject:</b> Re: Could Not Connect To Server</div>
<div>On 4/23/20 12:12 PM, Dummy Account wrote:<br/>
> Hi David,<br/>
> When I backed-up, I don't know if the server was offline? I can say<br/>
> that I was not running pgAdmin. For instance, I backed up the Operating<br/>
> System and all of its applications. If I go run other application,<br/>
> including other servers, they work. As a matter of fact, if I boot into<br/>
> the old hard drive while it is outside of the laptop, it still works<br/>
> just as it did before I took it out of the laptop.<br/>
> As far as your question of "And the relevant content from the log<br/>
> directory log file?": what are you asking for? That *is* the entire and<br/>
> complete log after that command.<br/>
<br/>
Those are the messages sent to the screen. There are also messages sent<br/>
to the Postgres server log. Not sure where the OS X install puts that,<br/>
but I would start under /Library/PostgreSQL/12/data.<br/>
<br/>
> Thanks, I appreciate the help.<br/>
> *Sent:* Thursday, April 23, 2020 at 1:55 PM<br/>
> *From:* "David G. Johnston" <david.g.johnston@gmail.com><br/>
> *To:* "Dummy Account" <dummyaccount4u@mail.com><br/>
> *Cc:* "pgsql-general" <pgsql-general@postgresql.org><br/>
> *Subject:* Re: Could Not Connect To Server<br/>
> On Thu, Apr 23, 2020 at 11:48 AM Dummy Account <dummyaccount4u@mail.com<br/>
> <mailto:dummyaccount4u@mail.com>> wrote:<br/>
><br/>
> But here they are:<br/>
><br/>
> waiting for server to start....2020-04-22 15:57:51.766 CDT [5255]<br/>
> LOG: starting PostgreSQL 12.2 on x86_64-apple-darwin, compiled by<br/>
> Apple LLVM version 6.0 (clang-600.0.54) (based on LLVM 3.5svn), 64-bit<br/>
> 2020-04-22 15:57:51.766 CDT [5255] LOG: listening on IPv6 address<br/>
> "::", port 5432<br/>
> 2020-04-22 15:57:51.766 CDT [5255] LOG: listening on IPv4 address<br/>
> "0.0.0.0", port 5432<br/>
> 2020-04-22 15:57:51.768 CDT [5255] LOG: listening on Unix socket<br/>
> "/tmp/.s.PGSQL.5432"<br/>
> 2020-04-22 15:57:51.782 CDT [5255] LOG: redirecting log output to<br/>
> logging collector process<br/>
> 2020-04-22 15:57:51.782 CDT [5255] HINT: Future log output will<br/>
> appear in directory "log".<br/>
><br/>
> And the relevant content from the log directory log file?<br/>
><br/>
> stopped waiting<br/>
> pg_ctl: could not start server<br/>
> You might be misunderstanding where I said restore, I did not backup<br/>
> the database, I restored an Operating System because I changed out<br/>
> my hard drive for a solid state drive; therefore, I had to restore<br/>
> my Operating System from Time Machine/(backup).<br/>
><br/>
> And was that Time Machine backup made while the server was offline? If<br/>
> not, and you didn't take any explicit steps to backup and restore the<br/>
> database itself, then your database may be corrupted and thus unable to<br/>
> boot. The log file should indicate whether that is the case.<br/>
> David J.<br/>
<br/>
<br/>
--<br/>
Adrian Klaver<br/>
adrian.klaver@aklaver.com</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div></div></body></html>
On 4/23/20 1:24 PM, Dummy Account wrote:
Hey Everyone,
I did find loggin.h and insallation_summary.log. Neither of which look
to include the info you may want.
Please advise as to what log file you want to see.
Did you look under:
/Library/PostgreSQL/12/data
directory for sub-directory?:
log/
And under it for log files?
Thanks
*Sent:* Thursday, April 23, 2020 at 2:32 PM
*From:* "Dummy Account" <dummyaccount4u@mail.com>
*To:* "Adrian Klaver" <adrian.klaver@aklaver.com>
*Cc:* "David G. Johnston" <david.g.johnston@gmail.com>, "pgsql-general"
<pgsql-general@postgresql.org>
*Subject:* Re: Could Not Connect To Server
Hey David,
Can you tell me the exact name of the log file? Then I can search for it.
Thanks
*Sent:* Thursday, April 23, 2020 at 2:25 PM
*From:* "Adrian Klaver" <adrian.klaver@aklaver.com>
*To:* "Dummy Account" <dummyaccount4u@mail.com>, "David G. Johnston"
<david.g.johnston@gmail.com>
*Cc:* "pgsql-general" <pgsql-general@postgresql.org>
*Subject:* Re: Could Not Connect To Server
On 4/23/20 12:12 PM, Dummy Account wrote:Hi David,
When I backed-up, I don't know if the server was offline? I can say
that I was not running pgAdmin. For instance, I backed up the Operating
System and all of its applications. If I go run other application,
including other servers, they work. As a matter of fact, if I boot into
the old hard drive while it is outside of the laptop, it still works
just as it did before I took it out of the laptop.
As far as your question of "And the relevant content from the log
directory log file?": what are you asking for? That *is* the entire and
complete log after that command.Those are the messages sent to the screen. There are also messages sent
to the Postgres server log. Not sure where the OS X install puts that,
but I would start under /Library/PostgreSQL/12/data.Thanks, I appreciate the help.
*Sent:* Thursday, April 23, 2020 at 1:55 PM
*From:* "David G. Johnston" <david.g.johnston@gmail.com>
*To:* "Dummy Account" <dummyaccount4u@mail.com>
*Cc:* "pgsql-general" <pgsql-general@postgresql.org>
*Subject:* Re: Could Not Connect To Server
On Thu, Apr 23, 2020 at 11:48 AM Dummy Account <dummyaccount4u@mail.com
<mailto:dummyaccount4u@mail.com>> wrote:But here they are:
waiting for server to start....2020-04-22 15:57:51.766 CDT [5255]
LOG: starting PostgreSQL 12.2 on x86_64-apple-darwin, compiled by
Apple LLVM version 6.0 (clang-600.0.54) (based on LLVM 3.5svn), 64-bit
2020-04-22 15:57:51.766 CDT [5255] LOG: listening on IPv6 address
"::", port 5432
2020-04-22 15:57:51.766 CDT [5255] LOG: listening on IPv4 address
"0.0.0.0", port 5432
2020-04-22 15:57:51.768 CDT [5255] LOG: listening on Unix socket
"/tmp/.s.PGSQL.5432"
2020-04-22 15:57:51.782 CDT [5255] LOG: redirecting log output to
logging collector process
2020-04-22 15:57:51.782 CDT [5255] HINT: Future log output will
appear in directory "log".And the relevant content from the log directory log file?
stopped waiting
pg_ctl: could not start server
You might be misunderstanding where I said restore, I did not backup
the database, I restored an Operating System because I changed out
my hard drive for a solid state drive; therefore, I had to restore
my Operating System from Time Machine/(backup).And was that Time Machine backup made while the server was offline? If
not, and you didn't take any explicit steps to backup and restore the
database itself, then your database may be corrupted and thus unable to
boot. The log file should indicate whether that is the case.
David J.--
Adrian Klaver
adrian.klaver@aklaver.com
--
Adrian Klaver
adrian.klaver@aklaver.com
<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div> </div>
<div>
<div>From the Finder, I think that is the same a File Explorer on Widows. From Finder, it's locked; I cannot access it. Could I use the command line and change ownership or access privledges? And then get access?</div>
<div> </div>
<div>Thanks</div>
<div>
<div name="quote" style="margin:10px 5px 5px 10px; padding: 10px 0 10px 10px; border-left:2px solid #C3D9E5; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<div style="margin:0 0 10px 0;"><b>Sent:</b> Thursday, April 23, 2020 at 3:27 PM<br/>
<b>From:</b> "Adrian Klaver" <adrian.klaver@aklaver.com><br/>
<b>To:</b> "Dummy Account" <dummyaccount4u@mail.com>, "pgsql-general" <pgsql-general@postgresql.org>, "David G. Johnston" <david.g.johnston@gmail.com><br/>
<b>Subject:</b> Re: Fw: Re: Could Not Connect To Server</div>
<div name="quoted-content">On 4/23/20 1:24 PM, Dummy Account wrote:<br/>
> Hey Everyone,<br/>
> I did find loggin.h and insallation_summary.log. Neither of which look<br/>
> to include the info you may want.<br/>
> Please advise as to what log file you want to see.<br/>
<br/>
Did you look under:<br/>
<br/>
/Library/PostgreSQL/12/data<br/>
<br/>
directory for sub-directory?:<br/>
<br/>
log/<br/>
<br/>
And under it for log files?<br/>
<br/>
> Thanks<br/>
> *Sent:* Thursday, April 23, 2020 at 2:32 PM<br/>
> *From:* "Dummy Account" <dummyaccount4u@mail.com><br/>
> *To:* "Adrian Klaver" <adrian.klaver@aklaver.com><br/>
> *Cc:* "David G. Johnston" <david.g.johnston@gmail.com>, "pgsql-general"<br/>
> <pgsql-general@postgresql.org><br/>
> *Subject:* Re: Could Not Connect To Server<br/>
> Hey David,<br/>
> Can you tell me the exact name of the log file? Then I can search for it.<br/>
> Thanks<br/>
> *Sent:* Thursday, April 23, 2020 at 2:25 PM<br/>
> *From:* "Adrian Klaver" <adrian.klaver@aklaver.com><br/>
> *To:* "Dummy Account" <dummyaccount4u@mail.com>, "David G. Johnston"<br/>
> <david.g.johnston@gmail.com><br/>
> *Cc:* "pgsql-general" <pgsql-general@postgresql.org><br/>
> *Subject:* Re: Could Not Connect To Server<br/>
> On 4/23/20 12:12 PM, Dummy Account wrote:<br/>
> > Hi David,<br/>
> > When I backed-up, I don't know if the server was offline? I can say<br/>
> > that I was not running pgAdmin. For instance, I backed up the Operating<br/>
> > System and all of its applications. If I go run other application,<br/>
> > including other servers, they work. As a matter of fact, if I boot into<br/>
> > the old hard drive while it is outside of the laptop, it still works<br/>
> > just as it did before I took it out of the laptop.<br/>
> > As far as your question of "And the relevant content from the log<br/>
> > directory log file?": what are you asking for? That *is* the entire and<br/>
> > complete log after that command.<br/>
><br/>
> Those are the messages sent to the screen. There are also messages sent<br/>
> to the Postgres server log. Not sure where the OS X install puts that,<br/>
> but I would start under /Library/PostgreSQL/12/data.<br/>
><br/>
> > Thanks, I appreciate the help.<br/>
> > *Sent:* Thursday, April 23, 2020 at 1:55 PM<br/>
> > *From:* "David G. Johnston" <david.g.johnston@gmail.com><br/>
> > *To:* "Dummy Account" <dummyaccount4u@mail.com><br/>
> > *Cc:* "pgsql-general" <pgsql-general@postgresql.org><br/>
> > *Subject:* Re: Could Not Connect To Server<br/>
> > On Thu, Apr 23, 2020 at 11:48 AM Dummy Account <dummyaccount4u@mail.com<br/>
> > <mailto:dummyaccount4u@mail.com>> wrote:<br/>
> ><br/>
> > But here they are:<br/>
> ><br/>
> > waiting for server to start....2020-04-22 15:57:51.766 CDT [5255]<br/>
> > LOG: starting PostgreSQL 12.2 on x86_64-apple-darwin, compiled by<br/>
> > Apple LLVM version 6.0 (clang-600.0.54) (based on LLVM 3.5svn), 64-bit<br/>
> > 2020-04-22 15:57:51.766 CDT [5255] LOG: listening on IPv6 address<br/>
> > "::", port 5432<br/>
> > 2020-04-22 15:57:51.766 CDT [5255] LOG: listening on IPv4 address<br/>
> > "0.0.0.0", port 5432<br/>
> > 2020-04-22 15:57:51.768 CDT [5255] LOG: listening on Unix socket<br/>
> > "/tmp/.s.PGSQL.5432"<br/>
> > 2020-04-22 15:57:51.782 CDT [5255] LOG: redirecting log output to<br/>
> > logging collector process<br/>
> > 2020-04-22 15:57:51.782 CDT [5255] HINT: Future log output will<br/>
> > appear in directory "log".<br/>
> ><br/>
> > And the relevant content from the log directory log file?<br/>
> ><br/>
> > stopped waiting<br/>
> > pg_ctl: could not start server<br/>
> > You might be misunderstanding where I said restore, I did not backup<br/>
> > the database, I restored an Operating System because I changed out<br/>
> > my hard drive for a solid state drive; therefore, I had to restore<br/>
> > my Operating System from Time Machine/(backup).<br/>
> ><br/>
> > And was that Time Machine backup made while the server was offline? If<br/>
> > not, and you didn't take any explicit steps to backup and restore the<br/>
> > database itself, then your database may be corrupted and thus unable to<br/>
> > boot. The log file should indicate whether that is the case.<br/>
> > David J.<br/>
><br/>
><br/>
> --<br/>
> Adrian Klaver<br/>
> adrian.klaver@aklaver.com<br/>
<br/>
<br/>
--<br/>
Adrian Klaver<br/>
adrian.klaver@aklaver.com</div>
</div>
</div>
</div></div></body></html>
On 4/23/20 1:37 PM, Dummy Account wrote:
From the Finder, I think that is the same a File Explorer on Widows.
From Finder, it's locked; I cannot access it. Could I use the command
line and change ownership or access privledges? And then get access?
Why not from the command line use a text editor to view the file(s)?
Thanks
--
Adrian Klaver
adrian.klaver@aklaver.com
On 4/23/20 3:26 PM, Adrian Klaver wrote:
On 4/23/20 1:37 PM, Dummy Account wrote:
From the Finder, I think that is the same a File Explorer on Widows.
From Finder, it's locked; I cannot access it. Could I use the
command line and change ownership or access privledges? And then get
access?Why not from the command line use a text editor to view the file(s)?
Thanks
Does this work for you in a terminal?
sudo su - postgres
<your login password>
cd /Library/PostgreSQL
find . -name log
From your first post, that ought to find the "log" mentioned in the
output (and possible more than one if you have multiple installations).
As Peter pointed out that's a directory. The logs will be in there.
cd <dir found from find command>
ls -ltr
Should show the most recent file last. That's likely the file of interest.
Show quoted text
<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div> </div>
<div>
<div>I cannot login into a postgres role via command line. </div>
<div> </div>
<div>Issue #1.</div>
<div>I have never done it before via command line, so maybe I am doing it incorrectly.</div>
<div>I have been attempting to go: </div>
<div> </div>
<div>su - postgres</div>
<div> </div>
<div>Then it prompts me for the password.</div>
<div>Unfortunately, none of the passwords that I think would pertain to Postgres or PgAdmin work. </div>
<div>What does work, is the "master password" that I use to log into the pgAdmin Graphical User Interface.</div>
<div>I would think that one would work, but it does not.</div>
<div> </div>
<div>Issue #2.</div>
<div>I am thinking out loud hear, there are 3 passwords:</div>
<div>Operating System Admin Password: I know that.</div>
<div>pgAmin password: I know that.</div>
<div>PostgreSQL 12 - the server with multiple database on it. I believe I know that?</div>
<div>The issue with that is, while it was not letting me connect, I selected what I think was called "clear password".</div>
<div>Nonetheless, I still have what pgAdmin calls the "master password".</div>
<div>So even if I did remove the password for "PostgreSQL" server, would I be able to reset one? </div>
<div>
<div name="quote" style="margin:10px 5px 5px 10px; padding: 10px 0 10px 10px; border-left:2px solid #C3D9E5; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<div style="margin:0 0 10px 0;"><b>Sent:</b> Thursday, April 23, 2020 at 4:26 PM<br/>
<b>From:</b> "Adrian Klaver" <adrian.klaver@aklaver.com><br/>
<b>To:</b> "Dummy Account" <dummyaccount4u@mail.com><br/>
<b>Cc:</b> "pgsql-general" <pgsql-general@postgresql.org>, "David G. Johnston" <david.g.johnston@gmail.com><br/>
<b>Subject:</b> Re: Fw: Re: Could Not Connect To Server</div>
<div name="quoted-content">On 4/23/20 1:37 PM, Dummy Account wrote:<br/>
> From the Finder, I think that is the same a File Explorer on Widows.<br/>
> From Finder, it's locked; I cannot access it. Could I use the command<br/>
> line and change ownership or access privledges? And then get access?<br/>
<br/>
Why not from the command line use a text editor to view the file(s)?<br/>
<br/>
> Thanks<br/>
<br/>
<br/>
<br/>
--<br/>
Adrian Klaver<br/>
adrian.klaver@aklaver.com</div>
</div>
</div>
</div></div></body></html>
On 4/23/20 3:03 PM, Dummy Account wrote:
I cannot login into a postgres role via command line.
Issue #1.
I have never done it before via command line, so maybe I am doing it
incorrectly.
I have been attempting to go:
su - postgres
Then it prompts me for the password.
Unfortunately, none of the passwords that I think would pertain to
Postgres or PgAdmin work.
What does work, is the "master password" that I use to log into the
pgAdmin Graphical User Interface.
I would think that one would work, but it does not.
What did you use to do?:
sudo -u postgres ./pg_ctl start -D /Library/PostgreSQL/12/data
Issue #2.
I am thinking out loud hear, there are 3 passwords:
Operating System Admin Password: I know that.
pgAmin password: I know that.
PostgreSQL 12 - the server with multiple database on it. I believe I
know that?
The issue with that is, while it was not letting me connect, I selected
what I think was called "clear password".
Nonetheless, I still have what pgAdmin calls the "master password".
So even if I did remove the password for "PostgreSQL" server, would I be
able to reset one?
*Sent:* Thursday, April 23, 2020 at 4:26 PM
*From:* "Adrian Klaver" <adrian.klaver@aklaver.com>
*To:* "Dummy Account" <dummyaccount4u@mail.com>
*Cc:* "pgsql-general" <pgsql-general@postgresql.org>, "David G.
Johnston" <david.g.johnston@gmail.com>
*Subject:* Re: Fw: Re: Could Not Connect To Server
On 4/23/20 1:37 PM, Dummy Account wrote:From the Finder, I think that is the same a File Explorer on Widows.
From Finder, it's locked; I cannot access it. Could I use the command
line and change ownership or access privledges? And then get access?Why not from the command line use a text editor to view the file(s)?
Thanks
--
Adrian Klaver
adrian.klaver@aklaver.com
--
Adrian Klaver
adrian.klaver@aklaver.com
On Thu, Apr 23, 2020 at 3:03 PM Dummy Account <dummyaccount4u@mail.com>
wrote:
I cannot login into a postgres role via command line.
Issue #1.
I have never done it before via command line, so maybe I am doing it
incorrectly.
I have been attempting to go:su - postgres
The "sudo" in Rob's answer wasn't optional. Attempting to use sudo should
require the OS Admin Password
David J.
<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div>This worked.</div>
<div>
<div>sudo su - postgres</div>
<div>I was now able to log into data and ls</div>
<div>Inside data is "log".</div>
<div> </div>
<div>How do I open log?</div>
<div>and got:</div>
<div>LSOpenURLsWithRole() failed with erro -610</div>
<div>
<div> </div>
<div>I then tried:</div>
<div>log show</div>
<div>and I got:</div>
<div>log: Could not be open local log store: The log archive format is corrupt and cannot be read</div>
<div> </div>
<div>So that right there sounds more conducive to the OS being restored( not that I know ), all the files were likely rewritten?</div>
<div> </div>
<div> </div>
<div name="quote" style="margin:10px 5px 5px 10px; padding: 10px 0 10px 10px; border-left:2px solid #C3D9E5; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<div style="margin:0 0 10px 0;"><b>Sent:</b> Thursday, April 23, 2020 at 5:05 PM<br/>
<b>From:</b> "Adrian Klaver" <adrian.klaver@aklaver.com><br/>
<b>To:</b> "Dummy Account" <dummyaccount4u@mail.com><br/>
<b>Cc:</b> "pgsql-general" <pgsql-general@postgresql.org>, "David G. Johnston" <david.g.johnston@gmail.com><br/>
<b>Subject:</b> Re: Fw: Re: Could Not Connect To Server</div>
<div name="quoted-content">On 4/23/20 3:03 PM, Dummy Account wrote:<br/>
> I cannot login into a postgres role via command line.<br/>
> Issue #1.<br/>
> I have never done it before via command line, so maybe I am doing it<br/>
> incorrectly.<br/>
> I have been attempting to go:<br/>
> su - postgres<br/>
> Then it prompts me for the password.<br/>
> Unfortunately, none of the passwords that I think would pertain to<br/>
> Postgres or PgAdmin work.<br/>
> What does work, is the "master password" that I use to log into the<br/>
> pgAdmin Graphical User Interface.<br/>
> I would think that one would work, but it does not.<br/>
<br/>
What did you use to do?:<br/>
<br/>
sudo -u postgres ./pg_ctl start -D /Library/PostgreSQL/12/data<br/>
<br/>
<br/>
> Issue #2.<br/>
> I am thinking out loud hear, there are 3 passwords:<br/>
> Operating System Admin Password: I know that.<br/>
> pgAmin password: I know that.<br/>
> PostgreSQL 12 - the server with multiple database on it. I believe I<br/>
> know that?<br/>
> The issue with that is, while it was not letting me connect, I selected<br/>
> what I think was called "clear password".<br/>
> Nonetheless, I still have what pgAdmin calls the "master password".<br/>
> So even if I did remove the password for "PostgreSQL" server, would I be<br/>
> able to reset one?<br/>
> *Sent:* Thursday, April 23, 2020 at 4:26 PM<br/>
> *From:* "Adrian Klaver" <adrian.klaver@aklaver.com><br/>
> *To:* "Dummy Account" <dummyaccount4u@mail.com><br/>
> *Cc:* "pgsql-general" <pgsql-general@postgresql.org>, "David G.<br/>
> Johnston" <david.g.johnston@gmail.com><br/>
> *Subject:* Re: Fw: Re: Could Not Connect To Server<br/>
> On 4/23/20 1:37 PM, Dummy Account wrote:<br/>
> > From the Finder, I think that is the same a File Explorer on Widows.<br/>
> > From Finder, it's locked; I cannot access it. Could I use the command<br/>
> > line and change ownership or access privledges? And then get access?<br/>
><br/>
> Why not from the command line use a text editor to view the file(s)?<br/>
><br/>
> > Thanks<br/>
><br/>
><br/>
><br/>
> --<br/>
> Adrian Klaver<br/>
> adrian.klaver@aklaver.com<br/>
<br/>
<br/>
--<br/>
Adrian Klaver<br/>
adrian.klaver@aklaver.com</div>
</div>
</div>
</div></div></body></html>
On 4/23/20 4:19 PM, Dummy Account wrote:
This worked.
sudo su - postgres
I was now able to log into data and ls
Inside data is "log".
How do I open log?
and got:
LSOpenURLsWithRole() failed with erro -610
I then tried:
log show
and I got:
log: Could not be open local log store: The log archive format is
corrupt and cannot be read
So that right there sounds more conducive to the OS being restored(
not that I know ), all the files were likely rewritten?
"log" is another directory, correct?
cd log
ls -l
should show you the logfiles. Use a text editor on the most recently
written.