Re: Two started cluster on the same data directory and port

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: Loles <lolesft(at)gmail(dot)com>
Cc: Matthias Apitz <guru(at)unixarea(dot)de>, PostgreSQL <pgsql-general(at)postgresql(dot)org>
Subject: Re: Two started cluster on the same data directory and port
Date: 2023-12-01 16:17:15
Message-ID: 47915892-87c0-44d8-be07-11548ef915bf@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 12/1/23 01:17, Loles wrote:
> Yes, it seems to be caused by systemd.

To be more accurate it is caused by the the file postgresql-generator
located here:

/lib/systemd/system-generators/

That file is installed by the Postgres Debian/Ubuntu package, so it is
the Postgres install that is using systemd in this manner.

>
> I'll investigate there. If not, I can upgrade PostgreSQL and get rid of
> server 14.

If your directory structure resembles:

/etc/postgresql/14
├── main
│ ├── conf.d
│ ├── environment
│ ├── pg_ctl.conf
│ ├── pg_hba.conf
│ ├── pg_ident.conf
│ ├── postgresql.conf
│ └── start.conf
└── main_old
├── conf.d
├── environment
├── pg_ctl.conf
├── pg_hba.conf
├── pg_ident.conf
├── postgresql.conf
└── start.conf

Then you just need to:

1) Stop the server
2) mv or rm the main_old/ directory
3) Restart the server
>
> Thank you very much Adrian... I'm going to get a cup of coffee because
> the topic requires it :D
>
>
> El vie, 1 dic 2023 a las 6:19, Adrian Klaver (<adrian(dot)klaver(at)aklaver(dot)com
> <mailto:adrian(dot)klaver(at)aklaver(dot)com>>) escribió:
>
> On 11/30/23 20:43, Matthias Apitz wrote:
> > El día jueves, noviembre 30, 2023 a las 02:10:25p. m. -0800,
> Adrian Klaver escribió:
> >
> >> On 11/30/23 12:35, Adrian Klaver wrote:
> >>> On 11/30/23 10:35, Adrian Klaver wrote:
> >>>> On 11/30/23 09:27, Loles wrote:
> >>>>
> >>
> >>> cd /etc/postgresql/14/
> >>> sudo rm -r main_old/
> >>>     or
> >>> sudo cp -r main_old <some_new_path>
> >>
> >> Arrgh.
> >>
> >>      sudo mv -r main_old <some_new_path>
> >>
> >> Memo to self don't eat lunch and copy/paste at same time.
> >
> > Hmmm
> >
> > purism(at)pureos:~$ uname -s
> > Linux
> > purism(at)pureos:~$ mv -r foo bar
> > mv: invalid option -- 'r'
>
> The gift that keeps on giving. Third time's a charm?:
>
>         sudo mv  main_old/ <some_new_path>
>
> > Try 'mv --help' for more information.
> >
> >       matthias
>
> --
> Adrian Klaver
> adrian(dot)klaver(at)aklaver(dot)com <mailto:adrian(dot)klaver(at)aklaver(dot)com>
>

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2023-12-01 16:30:37 Re: Query related to pg_dump write to a pipe on a windows client and with compressed format
Previous Message Ron Johnson 2023-12-01 15:04:16 Re: Query related to pg_dump write to a pipe on a windows client and with compressed format