Re: Fix a typo in pg_rotate_logfile

2024-03-04 Thread Daniel Gustafsson
> On 14 Feb 2024, at 21:48, Daniel Gustafsson  wrote:
>> On 14 Feb 2024, at 19:51, Nathan Bossart  wrote:
>> On Wed, Feb 14, 2024 at 10:04:49AM -0500, Tom Lane wrote:
>>> Daniel Gustafsson  writes:

 Attached is a diff to show what it would look like to remove adminpack 
 (catalog
 version bump omitted on purpose to avoid conflicts until commit).
>>> 
>>> I don't see any references you missed, so +1.
>> 
>> Seems reasonable to me, too.
> 
> Thanks!  I'll put this in the next CF to keep it open for comments a bit
> longer, but will close it early in the CF.

This has now been pushed, adminpack has left the building.

--
Daniel Gustafsson





Re: Fix a typo in pg_rotate_logfile

2024-02-15 Thread Bharath Rupireddy
On Thu, Feb 15, 2024 at 2:18 AM Daniel Gustafsson  wrote:
>
> >>> Searching on Github and Debian Codesearch I cannot find any reference to 
> >>> anyone
> >>> using any function from adminpack.  With pgAdminIII being EOL it might be 
> >>> to
> >>> remove it now rather than be on the hook to maintain it for another 5 
> >>> years
> >>> until v17 goes EOL.  It'll still be around for years in V16->.
> >>
> >> Works for me.
> >>
> >>> Attached is a diff to show what it would look like to remove adminpack 
> >>> (catalog
> >>> version bump omitted on purpose to avoid conflicts until commit).
> >>
> >> I don't see any references you missed, so +1.
> >
> > Seems reasonable to me, too.
>
> Thanks!  I'll put this in the next CF to keep it open for comments a bit
> longer, but will close it early in the CF.

LGTM.

-- 
Bharath Rupireddy
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com




Re: Fix a typo in pg_rotate_logfile

2024-02-14 Thread Daniel Gustafsson
> On 14 Feb 2024, at 19:51, Nathan Bossart  wrote:
> 
> On Wed, Feb 14, 2024 at 10:04:49AM -0500, Tom Lane wrote:
>> Daniel Gustafsson  writes:
>>> On 14 Feb 2024, at 11:35, Dave Page  wrote:
 That said, pgAdmin III has been out of support for many years, and as
 far as I know, it (and similarly old versions of EDB's PEM which was
 based on it) were the only consumers of adminpack. I would not be sad
 to see it removed entirely
>> 
>>> Searching on Github and Debian Codesearch I cannot find any reference to 
>>> anyone
>>> using any function from adminpack.  With pgAdminIII being EOL it might be to
>>> remove it now rather than be on the hook to maintain it for another 5 years
>>> until v17 goes EOL.  It'll still be around for years in V16->.
>> 
>> Works for me.
>> 
>>> Attached is a diff to show what it would look like to remove adminpack 
>>> (catalog
>>> version bump omitted on purpose to avoid conflicts until commit).
>> 
>> I don't see any references you missed, so +1.
> 
> Seems reasonable to me, too.

Thanks!  I'll put this in the next CF to keep it open for comments a bit
longer, but will close it early in the CF.

--
Daniel Gustafsson





Re: Fix a typo in pg_rotate_logfile

2024-02-14 Thread Nathan Bossart
On Wed, Feb 14, 2024 at 10:04:49AM -0500, Tom Lane wrote:
> Daniel Gustafsson  writes:
>> On 14 Feb 2024, at 11:35, Dave Page  wrote:
>>> That said, pgAdmin III has been out of support for many years, and as
>>> far as I know, it (and similarly old versions of EDB's PEM which was
>>> based on it) were the only consumers of adminpack. I would not be sad
>>> to see it removed entirely
> 
>> Searching on Github and Debian Codesearch I cannot find any reference to 
>> anyone
>> using any function from adminpack.  With pgAdminIII being EOL it might be to
>> remove it now rather than be on the hook to maintain it for another 5 years
>> until v17 goes EOL.  It'll still be around for years in V16->.
> 
> Works for me.
> 
>> Attached is a diff to show what it would look like to remove adminpack 
>> (catalog
>> version bump omitted on purpose to avoid conflicts until commit).
> 
> I don't see any references you missed, so +1.

Seems reasonable to me, too.

-- 
Nathan Bossart
Amazon Web Services: https://aws.amazon.com




Re: Fix a typo in pg_rotate_logfile

2024-02-14 Thread Tom Lane
Daniel Gustafsson  writes:
> On 14 Feb 2024, at 11:35, Dave Page  wrote:
>> That said, pgAdmin III has been out of support for many years, and as far as 
>> I know, it (and similarly old versions of EDB's PEM which was based on it) 
>> were the only consumers of adminpack. I would not be sad to see it removed 
>> entirely

> Searching on Github and Debian Codesearch I cannot find any reference to 
> anyone
> using any function from adminpack.  With pgAdminIII being EOL it might be to
> remove it now rather than be on the hook to maintain it for another 5 years
> until v17 goes EOL.  It'll still be around for years in V16->.

Works for me.

> Attached is a diff to show what it would look like to remove adminpack 
> (catalog
> version bump omitted on purpose to avoid conflicts until commit).

I don't see any references you missed, so +1.

regards, tom lane




Re: Fix a typo in pg_rotate_logfile

2024-02-14 Thread Daniel Gustafsson
> On 14 Feb 2024, at 11:35, Dave Page  wrote:

> That said, pgAdmin III has been out of support for many years, and as far as 
> I know, it (and similarly old versions of EDB's PEM which was based on it) 
> were the only consumers of adminpack. I would not be sad to see it removed 
> entirely

Searching on Github and Debian Codesearch I cannot find any reference to anyone
using any function from adminpack.  With pgAdminIII being EOL it might be to
remove it now rather than be on the hook to maintain it for another 5 years
until v17 goes EOL.  It'll still be around for years in V16->.

If anyone still uses pgAdminIII then I have a hard time believing they are
diligently updating to the latest major version of postgres..

Attached is a diff to show what it would look like to remove adminpack (catalog
version bump omitted on purpose to avoid conflicts until commit).

--
Daniel Gustafsson



v1-0001-Remove-the-adminpack-extension.patch
Description: Binary data


Re: Fix a typo in pg_rotate_logfile

2024-02-14 Thread Dave Page
Hi

On Mon, 12 Feb 2024 at 21:31, Bharath Rupireddy <
bharath.rupireddyforpostg...@gmail.com> wrote:

> On Tue, Feb 13, 2024 at 2:29 AM Daniel Gustafsson  wrote:
> >
> > On that note though, we might want to consider just dropping it
> altogether in
> > v17 (while fixing the incorrect hint in backbranches)?  I can't imagine
> > adminpack 1.0 being in heavy use today, and skimming pgAdmin code it
> seems it's
> > only used in pgAdmin3 and not 4. Maybe it's time to simply drop old code?
>
> https://codesearch.debian.net/search?q=pg_logfile_rotate&literal=1
> shows no users for it though. There's pgadmin3 using it
>
> https://github.com/search?q=repo%3Apgadmin-org%2Fpgadmin3%20pg_logfile_rotate&type=code
> ,
> however the repo is archived. Surprisingly, core has to maintain the
> old code needed for adminpack 1.0 - pg_rotate_logfile_old SQL function
> and pg_rotate_logfile function in signalfuncs.c. These things could
> have been moved to adminpack.c back then and pointed CREATE FUNCTION
> pg_catalog.pg_logfile_rotate() to use it from adminpack.c. If we
> decide to remove adminpack 1.0 version completely, the 1.0 functions
> pg_file_read, pg_file_length and pg_logfile_rotate will also go away
> making adminpack code simpler.
>
> Having said that, it's good to hear from others, preferably from
> pgadmin developers - added Dave Page (dp...@pgadmin.org) in here for
> inputs.
>

As it happens we're currently implementing a redesigned version of that
functionality from pgAdmin III in pgAdmin 4. However, we are not using
adminpack for it.

FWIW, the reason for the weird naming is that originally all the
functionality for reading/managing files was added entirely as the
adminpack extension. It was only later that some of the functionality was
moved into core, and renamed along the way (everyone likes blue for their
bikeshed right?). The old functions (albeit, rewritten to use the new core
functions) were kept in adminpack for backwards compatibility.

That said, pgAdmin III has been out of support for many years, and as far
as I know, it (and similarly old versions of EDB's PEM which was based on
it) were the only consumers of adminpack. I would not be sad to see it
removed entirely - except for the fact that I fondly remember being invited
to join -core immediately after a heated discussion with Tom about it!

-- 
Dave Page
pgAdmin: https://www.pgadmin.org
PostgreSQL: https://www.postgresql.org
EDB: https://www.enterprisedb.com


Re: Fix a typo in pg_rotate_logfile

2024-02-12 Thread Bharath Rupireddy
On Tue, Feb 13, 2024 at 2:29 AM Daniel Gustafsson  wrote:
>
> On that note though, we might want to consider just dropping it altogether in
> v17 (while fixing the incorrect hint in backbranches)?  I can't imagine
> adminpack 1.0 being in heavy use today, and skimming pgAdmin code it seems 
> it's
> only used in pgAdmin3 and not 4. Maybe it's time to simply drop old code?

https://codesearch.debian.net/search?q=pg_logfile_rotate&literal=1
shows no users for it though. There's pgadmin3 using it
https://github.com/search?q=repo%3Apgadmin-org%2Fpgadmin3%20pg_logfile_rotate&type=code,
however the repo is archived. Surprisingly, core has to maintain the
old code needed for adminpack 1.0 - pg_rotate_logfile_old SQL function
and pg_rotate_logfile function in signalfuncs.c. These things could
have been moved to adminpack.c back then and pointed CREATE FUNCTION
pg_catalog.pg_logfile_rotate() to use it from adminpack.c. If we
decide to remove adminpack 1.0 version completely, the 1.0 functions
pg_file_read, pg_file_length and pg_logfile_rotate will also go away
making adminpack code simpler.

Having said that, it's good to hear from others, preferably from
pgadmin developers - added Dave Page (dp...@pgadmin.org) in here for
inputs.

--
Bharath Rupireddy
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com




Re: Fix a typo in pg_rotate_logfile

2024-02-12 Thread Daniel Gustafsson
> On 12 Feb 2024, at 21:46, Nathan Bossart  wrote:
> 
> On Mon, Feb 12, 2024 at 09:39:06PM +0100, Daniel Gustafsson wrote:
>>> On 12 Feb 2024, at 21:32, Bharath Rupireddy 
>>>  wrote:
>>> I happened to notice a typo in pg_rotate_logfile in ipc/signalfuncs.c
>>> - the hint message wrongly mentions that pg_logfile_rotate is part of
>>> the core; which is actually not. pg_logfile_rotate is an adminpack's
>>> 1.0 SQL function dropped in 2.0. The core defines pg_rotate_logfile
>>> SQL function instead, so use that. Here's a patch to fix the typo.
>> 
>> Nice catch!  This needs to be backpatched all the way down to 12 as that
>> function wen't away a long time ago (it was marked as deprecated all the way
>> back in 9.1).
> 
> This is a bit strange because, with this patch, the HINT suggests using a
> function with the same name as the one it lives in.  IIUC this is because
> adminpack's pg_logfile_rotate() uses pg_rotate_logfile(), while core's
> pg_rotate_logfile() uses pg_rotate_logfile_v2().  I suppose trying to
> rename these might be more trouble than it's worth at this point, though...

Yeah, I doubt that's worth the churn.

On that note though, we might want to consider just dropping it altogether in
v17 (while fixing the incorrect hint in backbranches)?  I can't imagine
adminpack 1.0 being in heavy use today, and skimming pgAdmin code it seems it's
only used in pgAdmin3 and not 4. Maybe it's time to simply drop old code?

--
Daniel Gustafsson





Re: Fix a typo in pg_rotate_logfile

2024-02-12 Thread Nathan Bossart
On Mon, Feb 12, 2024 at 09:39:06PM +0100, Daniel Gustafsson wrote:
>> On 12 Feb 2024, at 21:32, Bharath Rupireddy 
>>  wrote:
>> I happened to notice a typo in pg_rotate_logfile in ipc/signalfuncs.c
>> - the hint message wrongly mentions that pg_logfile_rotate is part of
>> the core; which is actually not. pg_logfile_rotate is an adminpack's
>> 1.0 SQL function dropped in 2.0. The core defines pg_rotate_logfile
>> SQL function instead, so use that. Here's a patch to fix the typo.
> 
> Nice catch!  This needs to be backpatched all the way down to 12 as that
> function wen't away a long time ago (it was marked as deprecated all the way
> back in 9.1).

This is a bit strange because, with this patch, the HINT suggests using a
function with the same name as the one it lives in.  IIUC this is because
adminpack's pg_logfile_rotate() uses pg_rotate_logfile(), while core's
pg_rotate_logfile() uses pg_rotate_logfile_v2().  I suppose trying to
rename these might be more trouble than it's worth at this point, though...

-- 
Nathan Bossart
Amazon Web Services: https://aws.amazon.com




Re: Fix a typo in pg_rotate_logfile

2024-02-12 Thread Daniel Gustafsson
> On 12 Feb 2024, at 21:32, Bharath Rupireddy 
>  wrote:

> I happened to notice a typo in pg_rotate_logfile in ipc/signalfuncs.c
> - the hint message wrongly mentions that pg_logfile_rotate is part of
> the core; which is actually not. pg_logfile_rotate is an adminpack's
> 1.0 SQL function dropped in 2.0. The core defines pg_rotate_logfile
> SQL function instead, so use that. Here's a patch to fix the typo.

Nice catch!  This needs to be backpatched all the way down to 12 as that
function wen't away a long time ago (it was marked as deprecated all the way
back in 9.1).

--
Daniel Gustafsson





Fix a typo in pg_rotate_logfile

2024-02-12 Thread Bharath Rupireddy
Hi,

I happened to notice a typo in pg_rotate_logfile in ipc/signalfuncs.c
- the hint message wrongly mentions that pg_logfile_rotate is part of
the core; which is actually not. pg_logfile_rotate is an adminpack's
1.0 SQL function dropped in 2.0. The core defines pg_rotate_logfile
SQL function instead, so use that. Here's a patch to fix the typo.

--
Bharath Rupireddy
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com
From 18854ba341d892750fc75b9988ba107fe44e7c63 Mon Sep 17 00:00:00 2001
From: Bharath Rupireddy 
Date: Mon, 12 Feb 2024 13:30:31 +
Subject: [PATCH v1] Fix a typo in pg_rotate_logfile

---
 src/backend/storage/ipc/signalfuncs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/backend/storage/ipc/signalfuncs.c b/src/backend/storage/ipc/signalfuncs.c
index 81d1a59659..c05a2af48b 100644
--- a/src/backend/storage/ipc/signalfuncs.c
+++ b/src/backend/storage/ipc/signalfuncs.c
@@ -284,7 +284,7 @@ pg_rotate_logfile(PG_FUNCTION_ARGS)
  errmsg("must be superuser to rotate log files with adminpack 1.0"),
 		/* translator: %s is a SQL function name */
  errhint("Consider using %s, which is part of core, instead.",
-		 "pg_logfile_rotate()")));
+		 "pg_rotate_logfile()")));
 
 	if (!Logging_collector)
 	{
-- 
2.34.1