pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
ubuntu 18: PostgreSQL does not start. how can I totally remove and reinstall it
9+ messages / 7 participants
[nested] [flat]

* ubuntu 18: PostgreSQL does not start. how can I totally remove and reinstall it
@ 2021-01-23 20:36 robert rottermann <robert@redcor.ch>
  2021-01-23 20:40 ` Re: ubuntu 18: PostgreSQL does not start. how can I totally remove and reinstall it Ron <ronljohnsonjr@gmail.com>
  2021-01-23 20:45 ` Re: ubuntu 18: PostgreSQL does not start. how can I totally remove and reinstall it Adrian Klaver <adrian.klaver@aklaver.com>
  0 siblings, 2 replies; 9+ messages in thread

From: robert rottermann @ 2021-01-23 20:36 UTC (permalink / raw)
  To: pgsql-general; +Cc: robert rottermann <robert@redcor.ch>

Hi there

I made somehow a mess with my PostgreSQL installation an an ubuntu 18.4 with 
PostgreSQL 10.0

service postgresql status
● postgresql.service - PostgreSQL RDBMS
    Loaded: loaded (/lib/systemd/system/postgresql.service; enabled; vendor 
preset: enabled)
    Active: active (exited) since Sat 2021-01-23 21:21:13 CET; 2min 26s ago
   Process: 1853 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
  Main PID: 1853 (code=exited, status=0/SUCCESS)

I would like to remove everything, and reinstall.

How can I do that?

It seems, that

apt remove --purge postgresql
apt remove --purge postgresql-client

I not enough, as I have the same situation afterwards.

Or is there a way that I can rebuild PostgreSQL datastructure?

thanks

Robert






^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: ubuntu 18: PostgreSQL does not start. how can I totally remove and reinstall it
  2021-01-23 20:36 ubuntu 18: PostgreSQL does not start. how can I totally remove and reinstall it robert rottermann <robert@redcor.ch>
@ 2021-01-23 20:40 ` Ron <ronljohnsonjr@gmail.com>
  1 sibling, 0 replies; 9+ messages in thread

From: Ron @ 2021-01-23 20:40 UTC (permalink / raw)
  To: pgsql-general@lists.postgresql.org

On 1/23/21 2:36 PM, robert rottermann wrote:
> Hi there
>
> I made somehow a mess with my PostgreSQL installation an an ubuntu 18.4 
> with PostgreSQL 10.0
>
> service postgresql status
> ● postgresql.service - PostgreSQL RDBMS
>    Loaded: loaded (/lib/systemd/system/postgresql.service; enabled; vendor 
> preset: enabled)
>    Active: active (exited) since Sat 2021-01-23 21:21:13 CET; 2min 26s ago
>   Process: 1853 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
>  Main PID: 1853 (code=exited, status=0/SUCCESS)

What's the error?

>
> I would like to remove everything, and reinstall.
>
> How can I do that?
>
> It seems, that
>
> apt remove --purge postgresql
> apt remove --purge postgresql-client
>
> I not enough, as I have the same situation afterwards.

What happens after you purge the packages.

>
> Or is there a way that I can rebuild PostgreSQL datastructure?

Yes, but you haven't given us nearly enough information.

-- 
Angular momentum makes the world go 'round.





^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: ubuntu 18: PostgreSQL does not start. how can I totally remove and reinstall it
  2021-01-23 20:36 ubuntu 18: PostgreSQL does not start. how can I totally remove and reinstall it robert rottermann <robert@redcor.ch>
@ 2021-01-23 20:45 ` Adrian Klaver <adrian.klaver@aklaver.com>
  2021-01-24 06:58   ` Re: ubuntu 18: PostgreSQL does not start. how can I totally remove and reinstall it robert@redo2oo.ch <robert@redo2oo.ch>
  1 sibling, 1 reply; 9+ messages in thread

From: Adrian Klaver @ 2021-01-23 20:45 UTC (permalink / raw)
  To: robert rottermann <robert@redcor.ch>; pgsql-general

On 1/23/21 12:36 PM, robert rottermann wrote:
> Hi there
> 
> I made somehow a mess with my PostgreSQL installation an an ubuntu 18.4 
> with PostgreSQL 10.0
> 
> service postgresql status
> ● postgresql.service - PostgreSQL RDBMS
>     Loaded: loaded (/lib/systemd/system/postgresql.service; enabled; 
> vendor preset: enabled)
>     Active: active (exited) since Sat 2021-01-23 21:21:13 CET; 2min 26s ago
>    Process: 1853 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
>   Main PID: 1853 (code=exited, status=0/SUCCESS)

What if you try:

sudo service postgresql@10-main status

Also  what does:

pg_lsclusters

show?



> 
> I would like to remove everything, and reinstall.
> 
> How can I do that?
> 
> It seems, that
> 
> apt remove --purge postgresql
> apt remove --purge postgresql-client
> 
> I not enough, as I have the same situation afterwards.
> 
> Or is there a way that I can rebuild PostgreSQL datastructure?
> 
> thanks
> 
> Robert
> 
> 
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com





^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: ubuntu 18: PostgreSQL does not start. how can I totally remove and reinstall it
  2021-01-23 20:36 ubuntu 18: PostgreSQL does not start. how can I totally remove and reinstall it robert rottermann <robert@redcor.ch>
  2021-01-23 20:45 ` Re: ubuntu 18: PostgreSQL does not start. how can I totally remove and reinstall it Adrian Klaver <adrian.klaver@aklaver.com>
@ 2021-01-24 06:58   ` robert@redo2oo.ch <robert@redo2oo.ch>
  2021-01-24 07:04     ` Re: ubuntu 18: PostgreSQL does not start. how can I totally remove and reinstall it Julien Rouhaud <rjuju123@gmail.com>
  0 siblings, 1 reply; 9+ messages in thread

From: robert@redo2oo.ch @ 2021-01-24 06:58 UTC (permalink / raw)
  To: robert rottermann <robert@redcor.ch>; pgsql-general

Thanks Adrian

On 23.01.21 21:45, Adrian Klaver wrote:
> On 1/23/21 12:36 PM, robert rottermann wrote:
>> Hi there
>>
>> I made somehow a mess with my PostgreSQL installation an an ubuntu 18.4 with 
>> PostgreSQL 10.0
>>
>> service postgresql status
>> ● postgresql.service - PostgreSQL RDBMS
>>     Loaded: loaded (/lib/systemd/system/postgresql.service; enabled; vendor 
>> preset: enabled)
>>     Active: active (exited) since Sat 2021-01-23 21:21:13 CET; 2min 26s ago
>>    Process: 1853 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
>>   Main PID: 1853 (code=exited, status=0/SUCCESS)
>
> What if you try:
>
> sudo service postgresql@10-main status
>
> Also  what does:
>
> pg_lsclusters
>
> show?
root@elfero-test:~/scripts# pg_lsclusters
Ver Cluster Port Status Owner    Data directory              Log file
10  main    5433 online postgres /var/lib/postgresql/10/main 
/var/log/postgresql/postgresql-10-main.log
root@elfero-test:~/scripts# service postgresql@10-main status
● postgresql@10-main.service - PostgreSQL Cluster 10-main
    Loaded: loaded (/lib/systemd/system/postgresql@.service; indirect; vendor 
preset: enabled)
    Active: active (running) since Sat 2021-01-23 22:11:40 CET; 9h ago
   Process: 1348 ExecStart=/usr/bin/pg_ctlcluster --skip-systemctl-redirect 
10-main start (code=exited, status=0/SUCCESS)
  Main PID: 1460 (postgres)
     Tasks: 7 (limit: 4543)
    CGroup: /system.slice/system-postgresql.slice/postgresql@10-main.service
            ├─1460 /usr/lib/postgresql/10/bin/postgres -D 
/var/lib/postgresql/10/main -c config_file=/etc/postgresql/10/main/postgresql.conf
            ├─1471 postgres: 10/main: checkpointer process
            ├─1472 postgres: 10/main: writer process
            ├─1473 postgres: 10/main: wal writer process
            ├─1474 postgres: 10/main: autovacuum launcher process
            ├─1475 postgres: 10/main: stats collector process
            └─1476 postgres: 10/main: bgworker: logical replication launcher

Jan 23 22:11:38 elfero-test systemd[1]: Starting PostgreSQL Cluster 10-main...

Jan 23 22:11:40 elfero-test systemd[1]: Started PostgreSQL Cluster 10-main.


Now I can also run psql. (why I could not before, I do not know ..)
BUT still I can not access the db from python.
even a simple python script like:

importpsycopg2
conn = psycopg2.connect(host="localhost", user="postgres", database="postgres")

Produces:

root@elfero-test:~/scripts# python test_elfero.py
Traceback (most recent call last):
   File "test_elfero.py", line 2, in <module>
     conn = psycopg2.connect(host="localhost", user="postgres", database="postgres")
   File "/usr/lib/python2.7/dist-packages/psycopg2/__init__.py", line 130, in 
connect
     conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
psycopg2.OperationalError: 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?


Any help is much appreciated

Robert

^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: ubuntu 18: PostgreSQL does not start. how can I totally remove and reinstall it
  2021-01-23 20:36 ubuntu 18: PostgreSQL does not start. how can I totally remove and reinstall it robert rottermann <robert@redcor.ch>
  2021-01-23 20:45 ` Re: ubuntu 18: PostgreSQL does not start. how can I totally remove and reinstall it Adrian Klaver <adrian.klaver@aklaver.com>
  2021-01-24 06:58   ` Re: ubuntu 18: PostgreSQL does not start. how can I totally remove and reinstall it robert@redo2oo.ch <robert@redo2oo.ch>
@ 2021-01-24 07:04     ` Julien Rouhaud <rjuju123@gmail.com>
  2021-01-24 07:08       ` Re: ubuntu 18: PostgreSQL does not start. how can I totally remove and reinstall it Hemil Ruparel <hemilruparel2002@gmail.com>
  0 siblings, 1 reply; 9+ messages in thread

From: Julien Rouhaud @ 2021-01-24 07:04 UTC (permalink / raw)
  To: robert@redo2oo.ch <robert@redo2oo.ch>; +Cc: robert rottermann <robert@redcor.ch>; pgsql-general

On Sun, Jan 24, 2021 at 2:58 PM robert@redo2oo.ch <robert@redo2oo.ch> wrote:
>
> root@elfero-test:~/scripts# pg_lsclusters
> Ver Cluster Port Status Owner    Data directory              Log file
> 10  main    5433 online postgres /var/lib/postgresql/10/main /var/log/postgresql/postgresql-10-main.log
> [...]
> psycopg2.OperationalError: 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?

It looks like your instance is configured to listen on port 5433, not 5432.





^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: ubuntu 18: PostgreSQL does not start. how can I totally remove and reinstall it
  2021-01-23 20:36 ubuntu 18: PostgreSQL does not start. how can I totally remove and reinstall it robert rottermann <robert@redcor.ch>
  2021-01-23 20:45 ` Re: ubuntu 18: PostgreSQL does not start. how can I totally remove and reinstall it Adrian Klaver <adrian.klaver@aklaver.com>
  2021-01-24 06:58   ` Re: ubuntu 18: PostgreSQL does not start. how can I totally remove and reinstall it robert@redo2oo.ch <robert@redo2oo.ch>
  2021-01-24 07:04     ` Re: ubuntu 18: PostgreSQL does not start. how can I totally remove and reinstall it Julien Rouhaud <rjuju123@gmail.com>
@ 2021-01-24 07:08       ` Hemil Ruparel <hemilruparel2002@gmail.com>
  2021-01-24 17:37         ` Re: ubuntu 18: PostgreSQL does not start. how can I totally remove and reinstall it Adrian Klaver <adrian.klaver@aklaver.com>
  2021-01-24 18:57         ` Re: ubuntu 18: PostgreSQL does not start. how can I totally remove and reinstall it Daniele Varrazzo <daniele.varrazzo@gmail.com>
  2021-01-24 22:02         ` Re: ubuntu 18: PostgreSQL does not start. how can I totally remove and reinstall it Adrian Klaver <adrian.klaver@aklaver.com>
  0 siblings, 3 replies; 9+ messages in thread

From: Hemil Ruparel @ 2021-01-24 07:08 UTC (permalink / raw)
  To: Julien Rouhaud <rjuju123@gmail.com>; +Cc: robert@redo2oo.ch <robert@redo2oo.ch>; robert rottermann <robert@redcor.ch>; pgsql-general

One small note. Aside from the fact that your server is running from a
different port, psycopg2 does not support authentication without password
afaik. It has bit me twice

On Sun, Jan 24, 2021 at 12:34 PM Julien Rouhaud <rjuju123@gmail.com> wrote:

> On Sun, Jan 24, 2021 at 2:58 PM robert@redo2oo.ch <robert@redo2oo.ch>
> wrote:
> >
> > root@elfero-test:~/scripts# pg_lsclusters
> > Ver Cluster Port Status Owner    Data directory              Log file
> > 10  main    5433 online postgres /var/lib/postgresql/10/main
> /var/log/postgresql/postgresql-10-main.log
> > [...]
> > psycopg2.OperationalError: 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?
>
> It looks like your instance is configured to listen on port 5433, not 5432.
>
>
>

^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: ubuntu 18: PostgreSQL does not start. how can I totally remove and reinstall it
  2021-01-23 20:36 ubuntu 18: PostgreSQL does not start. how can I totally remove and reinstall it robert rottermann <robert@redcor.ch>
  2021-01-23 20:45 ` Re: ubuntu 18: PostgreSQL does not start. how can I totally remove and reinstall it Adrian Klaver <adrian.klaver@aklaver.com>
  2021-01-24 06:58   ` Re: ubuntu 18: PostgreSQL does not start. how can I totally remove and reinstall it robert@redo2oo.ch <robert@redo2oo.ch>
  2021-01-24 07:04     ` Re: ubuntu 18: PostgreSQL does not start. how can I totally remove and reinstall it Julien Rouhaud <rjuju123@gmail.com>
  2021-01-24 07:08       ` Re: ubuntu 18: PostgreSQL does not start. how can I totally remove and reinstall it Hemil Ruparel <hemilruparel2002@gmail.com>
@ 2021-01-24 17:37         ` Adrian Klaver <adrian.klaver@aklaver.com>
  2 siblings, 0 replies; 9+ messages in thread

From: Adrian Klaver @ 2021-01-24 17:37 UTC (permalink / raw)
  To: Hemil Ruparel <hemilruparel2002@gmail.com>; Julien Rouhaud <rjuju123@gmail.com>; +Cc: robert@redo2oo.ch <robert@redo2oo.ch>; robert rottermann <robert@redcor.ch>; pgsql-general

On 1/23/21 11:08 PM, Hemil Ruparel wrote:
> One small note. Aside from the fact that your server is running from a 
> different port, psycopg2 does not support authentication without 
> password afaik. It has bit me twice

You will need to explain that further as I have not seen that over many 
years using psycopg2.



-- 
Adrian Klaver
adrian.klaver@aklaver.com





^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: ubuntu 18: PostgreSQL does not start. how can I totally remove and reinstall it
  2021-01-23 20:36 ubuntu 18: PostgreSQL does not start. how can I totally remove and reinstall it robert rottermann <robert@redcor.ch>
  2021-01-23 20:45 ` Re: ubuntu 18: PostgreSQL does not start. how can I totally remove and reinstall it Adrian Klaver <adrian.klaver@aklaver.com>
  2021-01-24 06:58   ` Re: ubuntu 18: PostgreSQL does not start. how can I totally remove and reinstall it robert@redo2oo.ch <robert@redo2oo.ch>
  2021-01-24 07:04     ` Re: ubuntu 18: PostgreSQL does not start. how can I totally remove and reinstall it Julien Rouhaud <rjuju123@gmail.com>
  2021-01-24 07:08       ` Re: ubuntu 18: PostgreSQL does not start. how can I totally remove and reinstall it Hemil Ruparel <hemilruparel2002@gmail.com>
@ 2021-01-24 18:57         ` Daniele Varrazzo <daniele.varrazzo@gmail.com>
  2 siblings, 0 replies; 9+ messages in thread

From: Daniele Varrazzo @ 2021-01-24 18:57 UTC (permalink / raw)
  To: Hemil Ruparel <hemilruparel2002@gmail.com>; +Cc: Julien Rouhaud <rjuju123@gmail.com>; robert@redo2oo.ch <robert@redo2oo.ch>; robert rottermann <robert@redcor.ch>; pgsql-general

On Sun, 24 Jan 2021 at 08:09, Hemil Ruparel <hemilruparel2002@gmail.com> wrote:
>
> One small note. Aside from the fact that your server is running from a different port, psycopg2 does not support authentication without password afaik. It has bit me twice

It is more likely that you have some misunderstanding around
PostgreSQL authentication. If you have an example we can look into it.

-- Daniele





^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: ubuntu 18: PostgreSQL does not start. how can I totally remove and reinstall it
  2021-01-23 20:36 ubuntu 18: PostgreSQL does not start. how can I totally remove and reinstall it robert rottermann <robert@redcor.ch>
  2021-01-23 20:45 ` Re: ubuntu 18: PostgreSQL does not start. how can I totally remove and reinstall it Adrian Klaver <adrian.klaver@aklaver.com>
  2021-01-24 06:58   ` Re: ubuntu 18: PostgreSQL does not start. how can I totally remove and reinstall it robert@redo2oo.ch <robert@redo2oo.ch>
  2021-01-24 07:04     ` Re: ubuntu 18: PostgreSQL does not start. how can I totally remove and reinstall it Julien Rouhaud <rjuju123@gmail.com>
  2021-01-24 07:08       ` Re: ubuntu 18: PostgreSQL does not start. how can I totally remove and reinstall it Hemil Ruparel <hemilruparel2002@gmail.com>
@ 2021-01-24 22:02         ` Adrian Klaver <adrian.klaver@aklaver.com>
  2 siblings, 0 replies; 9+ messages in thread

From: Adrian Klaver @ 2021-01-24 22:02 UTC (permalink / raw)
  To: Hemil Ruparel <hemilruparel2002@gmail.com>; Julien Rouhaud <rjuju123@gmail.com>; +Cc: robert@redo2oo.ch <robert@redo2oo.ch>; robert rottermann <robert@redcor.ch>; pgsql-general

On 1/23/21 11:08 PM, Hemil Ruparel wrote:
> One small note. Aside from the fact that your server is running from a 
> different port, psycopg2 does not support authentication without 
> password afaik. It has bit me twice

Some thinking on this made me realize where you could get into this 
situation. Namely if you are using psycopg2 compiled against an older 
version of libpq that you then use to connect to a newer version of the 
server that is using an authentication method that the libpq version 
does not know about. This however is a generic issue of mismatched 
libraries and not unique to psycopg2.



-- 
Adrian Klaver
adrian.klaver@aklaver.com





^ permalink  raw  reply  [nested|flat] 9+ messages in thread


end of thread, other threads:[~2021-01-24 22:02 UTC | newest]

Thread overview: 9+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-01-23 20:36 ubuntu 18: PostgreSQL does not start. how can I totally remove and reinstall it robert rottermann <robert@redcor.ch>
2021-01-23 20:40 ` Ron <ronljohnsonjr@gmail.com>
2021-01-23 20:45 ` Adrian Klaver <adrian.klaver@aklaver.com>
2021-01-24 06:58   ` robert@redo2oo.ch <robert@redo2oo.ch>
2021-01-24 07:04     ` Julien Rouhaud <rjuju123@gmail.com>
2021-01-24 07:08       ` Hemil Ruparel <hemilruparel2002@gmail.com>
2021-01-24 17:37         ` Adrian Klaver <adrian.klaver@aklaver.com>
2021-01-24 18:57         ` Daniele Varrazzo <daniele.varrazzo@gmail.com>
2021-01-24 22:02         ` Adrian Klaver <adrian.klaver@aklaver.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox