Обсуждение: initdb execution

Поиск
Список
Период
Сортировка

initdb execution

От
Azimuddin Mohammed
Дата:
Hello I have a question regrading initdb,
My understanding of initdb is when we execute it it will create the directory structure in /data.
My question is when we run initdb when we already have a database running and for some reason I run this command what happens to my existing actual data does it get flushed out ? In that case what is the best practice here?

--

Regards,
Azim

Re: initdb execution

От
Francisco Olarte
Дата:
Azim

On Fri, Feb 9, 2018 at 6:36 PM, Azimuddin Mohammed <azimeiu@gmail.com> wrote:
> Hello I have a question regrading initdb,
> My understanding of initdb is when we execute it it will create the
> directory structure in /data.
> My question is when we run initdb when we already have a database running
> and for some reason I run this command what happens to my existing actual
> data does it get flushed out ? In that case what is the best practice here?

I think initdb refuses to run when given an existent non empty
directory, but cannot find anything in its doc page...

Ok, after a little googling I've found "initdb will refuse to run if
the data directory exists and already contains files; this is to
prevent accidentally overwriting an existing installation." in the
server setup / creating cluster docs (
https://www.postgresql.org/docs/10/static/creating-cluster.html ).

Francisco Olarte.


Re: initdb execution

От
Francisco Olarte
Дата:
Azim

On Fri, Feb 9, 2018 at 6:36 PM, Azimuddin Mohammed <azimeiu@gmail.com> wrote:
> Hello I have a question regrading initdb,
> My understanding of initdb is when we execute it it will create the
> directory structure in /data.
> My question is when we run initdb when we already have a database running
> and for some reason I run this command what happens to my existing actual
> data does it get flushed out ? In that case what is the best practice here?

I think initdb refuses to run when given an existent non empty
directory, but cannot find anything in its doc page...

Ok, after a little googling I've found "initdb will refuse to run if
the data directory exists and already contains files; this is to
prevent accidentally overwriting an existing installation." in the
server setup / creating cluster docs (
https://www.postgresql.org/docs/10/static/creating-cluster.html ).

Francisco Olarte.


Re: initdb execution

От
Azimuddin Mohammed
Дата:
Thanks for the reply..
Let me execute in the newly built setup.

On Fri, Feb 9, 2018 at 11:50 AM, Francisco Olarte <folarte@peoplecall.com> wrote:
Azim

On Fri, Feb 9, 2018 at 6:36 PM, Azimuddin Mohammed <azimeiu@gmail.com> wrote:
> Hello I have a question regrading initdb,
> My understanding of initdb is when we execute it it will create the
> directory structure in /data.
> My question is when we run initdb when we already have a database running
> and for some reason I run this command what happens to my existing actual
> data does it get flushed out ? In that case what is the best practice here?

I think initdb refuses to run when given an existent non empty
directory, but cannot find anything in its doc page...

Ok, after a little googling I've found "initdb will refuse to run if
the data directory exists and already contains files; this is to
prevent accidentally overwriting an existing installation." in the
server setup / creating cluster docs (
https://www.postgresql.org/docs/10/static/creating-cluster.html ).

Francisco Olarte.



--

Regards,
Azim

Re: initdb execution

От
Azimuddin Mohammed
Дата:
Thanks for the reply..
Let me execute in the newly built setup.

On Fri, Feb 9, 2018 at 11:50 AM, Francisco Olarte <folarte@peoplecall.com> wrote:
Azim

On Fri, Feb 9, 2018 at 6:36 PM, Azimuddin Mohammed <azimeiu@gmail.com> wrote:
> Hello I have a question regrading initdb,
> My understanding of initdb is when we execute it it will create the
> directory structure in /data.
> My question is when we run initdb when we already have a database running
> and for some reason I run this command what happens to my existing actual
> data does it get flushed out ? In that case what is the best practice here?

I think initdb refuses to run when given an existent non empty
directory, but cannot find anything in its doc page...

Ok, after a little googling I've found "initdb will refuse to run if
the data directory exists and already contains files; this is to
prevent accidentally overwriting an existing installation." in the
server setup / creating cluster docs (
https://www.postgresql.org/docs/10/static/creating-cluster.html ).

Francisco Olarte.



--

Regards,
Azim