pg.ddx.io pgsql-bugs@postgresql.org mailing list archive
help / color / mirror / Atom feedBUG #17735: Uninstall of one version wipes out logs for all versions
2+ messages / 2 participants
[nested] [flat]
* BUG #17735: Uninstall of one version wipes out logs for all versions
@ 2023-01-02 20:32 PG Bug reporting form <noreply@postgresql.org>
2023-01-03 00:03 ` Re: BUG #17735: Uninstall of one version wipes out logs for all versions Sam Bortman <sam.bortman@gmail.com>
0 siblings, 1 reply; 2+ messages in thread
From: PG Bug reporting form @ 2023-01-02 20:32 UTC (permalink / raw)
To: pgsql-bugs@lists.postgresql.org; +Cc: sam.bortman@gmail.com
The following bug has been logged on the website:
Bug reference: 17735
Logged by: Sam Bortman
Email address: sam.bortman@gmail.com
PostgreSQL version: 15.1
Operating system: Linux (Debian-based)
Description:
Hello,
The following is likely only an issue with the Devian-based distributions
and should be passed along to the package maintainer. I have no access to
other Linux systems to try this on. It may be a common issue, but I have no
way to verify this, currently.
I discovered an issue while having two versions of PostgreSQL (namely 14.x
and 15.1) installed side-by-side on an Ubuntu-based server. There were
absolutely no issues, or conflicts, nor were there any sort of negative
interaction between the versions at run-time. It worked like a charm!
When I issued an "sudo apt purge postgresql-14" command I was presented with
the familiar prompt of whether I wanted to wipe and data directory
associated with my PG 14 cluster. I replied in the affirmative. As
expected /var/lib/postgresql/14 was gone. So, far so good.
However, the /var/log/postgresql directory was also wiped in its entirety.
The directory has previously hosted both postgresql-14-main.log* log files,
as well as postgresql-15-main.log* files.
Expected behavior:
Since PG allows different versions to be installed concurrently, ideally
only the logs which embed the version number of the product being
uninstalled should be purged. In my case, postgresql-14-main.log* should
have been removed, to the exclusion of all other installed versions.
I realize that Debina-based installations do not make use log_filename,
which makes it possible to infer the product version from the log filename
(as mentioned above), whereas on other distributions it may be impossible to
tell which log file was created with which version.
So perhaps you want to consider excluding all log files from deletion when
such version-determination is impossible. Or perhaps the uninstallation
script on such distributions should parse to postgresql.conf file to
determine the value of log_filename is so that it knows what pattern to
delete. Nothing is fool-proof, but perhaps this is better than nothing?)
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: BUG #17735: Uninstall of one version wipes out logs for all versions
2023-01-02 20:32 BUG #17735: Uninstall of one version wipes out logs for all versions PG Bug reporting form <noreply@postgresql.org>
@ 2023-01-03 00:03 ` Sam Bortman <sam.bortman@gmail.com>
0 siblings, 0 replies; 2+ messages in thread
From: Sam Bortman @ 2023-01-03 00:03 UTC (permalink / raw)
To: pgsql-bugs@lists.postgresql.org
A few small typos in the original text are corrected below:
"wanted to wipe and data directory" should read "wanted to wipe *the* data
directory"
"make use log_filename" should read "make use *of* log_filename"
"should parse to postgresql.conf file" should read "should parse *the*
postgresql.conf file"
__________________
S. Bortman
n'eNow
On Mon, Jan 2, 2023 at 3:33 PM PG Bug reporting form <noreply@postgresql.org>
wrote:
> The following bug has been logged on the website:
>
> Bug reference: 17735
> Logged by: Sam Bortman
> Email address: sam.bortman@gmail.com
> PostgreSQL version: 15.1
> Operating system: Linux (Debian-based)
> Description:
>
> Hello,
>
> The following is likely only an issue with the Devian-based distributions
> and should be passed along to the package maintainer. I have no access to
> other Linux systems to try this on. It may be a common issue, but I have
> no
> way to verify this, currently.
>
> I discovered an issue while having two versions of PostgreSQL (namely 14.x
> and 15.1) installed side-by-side on an Ubuntu-based server. There were
> absolutely no issues, or conflicts, nor were there any sort of negative
> interaction between the versions at run-time. It worked like a charm!
>
> When I issued an "sudo apt purge postgresql-14" command I was presented
> with
> the familiar prompt of whether I wanted to wipe and data directory
> associated with my PG 14 cluster. I replied in the affirmative. As
> expected /var/lib/postgresql/14 was gone. So, far so good.
>
> However, the /var/log/postgresql directory was also wiped in its entirety.
> The directory has previously hosted both postgresql-14-main.log* log files,
> as well as postgresql-15-main.log* files.
>
> Expected behavior:
> Since PG allows different versions to be installed concurrently, ideally
> only the logs which embed the version number of the product being
> uninstalled should be purged. In my case, postgresql-14-main.log* should
> have been removed, to the exclusion of all other installed versions.
>
> I realize that Debina-based installations do not make use log_filename,
> which makes it possible to infer the product version from the log filename
> (as mentioned above), whereas on other distributions it may be impossible
> to
> tell which log file was created with which version.
>
> So perhaps you want to consider excluding all log files from deletion when
> such version-determination is impossible. Or perhaps the uninstallation
> script on such distributions should parse to postgresql.conf file to
> determine the value of log_filename is so that it knows what pattern to
> delete. Nothing is fool-proof, but perhaps this is better than nothing?)
>
>
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2023-01-03 00:03 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2023-01-02 20:32 BUG #17735: Uninstall of one version wipes out logs for all versions PG Bug reporting form <noreply@postgresql.org>
2023-01-03 00:03 ` Sam Bortman <sam.bortman@gmail.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