Re: pg_dump:qemu: uncaught target signal 7 (Bus error) - core dumped

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Srinath Reddy Sadipiralla <srinath2133(at)gmail(dot)com>
Cc: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, tushar <tushar(dot)ahuja(at)enterprisedb(dot)com>, "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: pg_dump:qemu: uncaught target signal 7 (Bus error) - core dumped
Date: 2025-12-09 17:49:14
Message-ID: 252514.1765302554@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Srinath Reddy Sadipiralla <srinath2133(at)gmail(dot)com> writes:
> I have a question about the initdb success
> message to start the server using pg_ctl. Can we update the -l logfile
> suggestion it prints at the end to something like -l
> /path/to/datadirectory/logfile instead?

"-l logfile" should be read as a recommendation to write to some
logfile, not as the literal text of the command. I don't think
that putting the log file into the data directory is good practice,
either.

> Here’s the issue I’m seeing: when PostgreSQL is installed from packages
> rather than built from source, the installation requires root privileges
> (sudo).
> That means directories like bin and lib are owned by root, and
> non-superusers
> can’t create new files there.
> If someone runs initdb from inside the bin directory and then blindly
> copy-pastes
> the suggested pg_ctl command, pg_ctl will attempt to write the logfile into
> the bin directory.

All of this seems to be predicated on the idea that someone would cd
into the bin directory and try to do work there. I don't understand
why we should regard that scenario as sufficiently probable to justify
contorting PG's behavior to make it fractionally less dangerous.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Shlok Kyal 2025-12-09 17:49:26 Re: Skipping schema changes in publication
Previous Message Shlok Kyal 2025-12-09 17:48:48 Re: Skipping schema changes in publication