[prev in list] [next in list] [prev in thread] [next in thread] 

List:       postgresql-general
Subject:    Re: PostgreSql Service different path
From:       chris navarroza <canavarroza.work () gmail ! com>
Date:       2022-10-27 5:36:33
Message-ID: CADRdQ7r_ZvHFwv2pE_oaR3-Vzy7PcQG0QQd=JsSrVYawBFZY+g () mail ! gmail ! com
[Download RAW message or body]

I fixed it by editing the postgresql-14.service PGDATA path to the new
directory

Thanks,

butching

On Mon, Oct 24, 2022 at 7:25 PM chris navarroza <canavarroza.work@gmail.com>
wrote:

> But I'm using a different path when I initdb /usr/pgsql-14/bin/initdb -D */home/dmartuser/pgsql/14/data
> *so  "/var/lib/pgsql/14/data/" is really empty. Is there a way to point
> the startup script to the new path  */home/dmartuser/pgsql/14/data*  ?
>
> Thanks,
>
> Chris Albert Navarroza
> Information Technology Officer I
> CTCO - ITDS - RDMD
>
>
> On Mon, Oct 24, 2022 at 6:57 PM Jeffrey Walton <noloader@gmail.com> wrote:
>
>> On Mon, Oct 24, 2022 at 6:38 AM chris navarroza
>> <canavarroza.work@gmail.com> wrote:
>> >
>> > I install postgresql14.5 with the following commands
>> >
>> > sudo yum install postgresql14-server postgresql14-contrib
>> >
>> >
>> > sudo su postgres
>> >
>> > cd /tmp
>> >
>> > /usr/pgsql-14/bin/initdb -D /home/dmartuser/pgsql/14/data
>> >
>> > and update the postgresql.conf to the new path, now when I start the
>> service, it has an error and when I check it says
>> >
>> > -- Unit postgresql-14.service has begun starting up.
>> > Oct 24 15:16:45 datamartds postgresql-14-check-db-dir[132338]:
>> "/var/lib/pgsql/14/data/" is missing or empty.
>> > Oct 24 15:16:45 datamartds postgresql-14-check-db-dir[132338]: Use
>> "/usr/pgsql-14/bin/postgresql-14-setup initdb" to initialize the database
>> cluster.
>> > Oct 24 15:16:45 datamartds postgresql-14-check-db-dir[132338]: See
>> /usr/share/doc/postgresql14/README.rpm-dist for more information.
>> > Oct 24 15:16:45 datamartds systemd[1]: postgresql-14.service: Control
>> process exited, code=exited status=1
>> > Oct 24 15:16:45 datamartds systemd[1]: postgresql-14.service: Failed
>> with result 'exit-code'.
>> >
>> > How can I point the service to read the new path (
>> /home/dmartuser/pgsql/14/data )?
>>
>> The startup script that is calling systemd should perform a `mkdir -p
>> /var/lib/pgsql/14/data` before calling the PostgreSQL binary.
>>
>> Jeff
>>
>

[Attachment #3 (text/html)]

<div dir="ltr">I fixed it by editing the postgresql-14.service PGDATA path to the new \
directory<br clear="all"><div><div dir="ltr" class="gmail_signature" \
data-smartmail="gmail_signature"><div \
dir="ltr"><div><br></div>Thanks,<div><br><div>butching</div></div></div></div></div></div><br><div \
class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Oct 24, 2022 at 7:25 PM \
chris navarroza &lt;<a \
href="mailto:canavarroza.work@gmail.com">canavarroza.work@gmail.com</a>&gt; \
wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">But \
I&#39;m using a different path when I initdb<font color="#500050">  \
/usr/pgsql-14/bin/initdb -D </font><b \
style="color:rgb(80,0,80)">/home/dmartuser/pgsql/14/data </b><font color="#000000">so \


&quot;/var/lib/pgsql/14/data/&quot; is really empty. Is there a way to point the \
startup script to the new path  </font>

<font color="#500050"> </font><b \
style="color:rgb(80,0,80)">/home/dmartuser/pgsql/14/data</b>    <font \
color="#000000">?</font><br clear="all"><div><div dir="ltr"><div \
dir="ltr"><div><br></div>Thanks,<div><br><div><span style="color:rgb(34,34,34)">Chris \
Albert Navarroza</span><br style="color:rgb(34,34,34)"><font size="1"><span \
style="color:rgb(34,34,34)">Information Technology Officer I</span><br \
style="color:rgb(34,34,34)"><span style="color:rgb(34,34,34)">CTCO - ITDS - \
RDMD</span></font><br></div></div></div></div></div><br></div><br><div \
class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Oct 24, 2022 at 6:57 PM \
Jeffrey Walton &lt;<a href="mailto:noloader@gmail.com" \
target="_blank">noloader@gmail.com</a>&gt; wrote:<br></div><blockquote \
class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid \
rgb(204,204,204);padding-left:1ex">On Mon, Oct 24, 2022 at 6:38 AM chris \
navarroza<br> &lt;<a href="mailto:canavarroza.work@gmail.com" \
target="_blank">canavarroza.work@gmail.com</a>&gt; wrote:<br> &gt;<br>
&gt; I install postgresql14.5 with the following commands<br>
&gt;<br>
&gt; sudo yum install postgresql14-server postgresql14-contrib<br>
&gt;<br>
&gt;<br>
&gt; sudo su postgres<br>
&gt;<br>
&gt; cd /tmp<br>
&gt;<br>
&gt; /usr/pgsql-14/bin/initdb -D /home/dmartuser/pgsql/14/data<br>
&gt;<br>
&gt; and update the postgresql.conf to the new path, now when I start the service, it \
has an error and when I check it says<br> &gt;<br>
&gt; -- Unit postgresql-14.service has begun starting up.<br>
&gt; Oct 24 15:16:45 datamartds postgresql-14-check-db-dir[132338]: \
&quot;/var/lib/pgsql/14/data/&quot; is missing or empty.<br> &gt; Oct 24 15:16:45 \
datamartds postgresql-14-check-db-dir[132338]: Use \
&quot;/usr/pgsql-14/bin/postgresql-14-setup initdb&quot; to initialize the database \
cluster.<br> &gt; Oct 24 15:16:45 datamartds postgresql-14-check-db-dir[132338]: See \
/usr/share/doc/postgresql14/README.rpm-dist for more information.<br> &gt; Oct 24 \
15:16:45 datamartds systemd[1]: postgresql-14.service: Control process exited, \
code=exited status=1<br> &gt; Oct 24 15:16:45 datamartds systemd[1]: \
postgresql-14.service: Failed with result &#39;exit-code&#39;.<br> &gt;<br>
&gt; How can I point the service to read the new path ( /home/dmartuser/pgsql/14/data \
)?<br> <br>
The startup script that is calling systemd should perform a `mkdir -p<br>
/var/lib/pgsql/14/data` before calling the PostgreSQL binary.<br>
<br>
Jeff<br>
</blockquote></div>
</blockquote></div>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic