mirror of
https://github.com/postgres/postgres.git
synced 2025-12-21 05:21:08 +03:00
Remove the adminpack contrib extension
The adminpack extension was only used to support pgAdmin III, which in turn was declared EOL many years ago. Removing the extension also allows us to remove functions from core as well which were only used to support old version of adminpack. Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Reviewed-by: Nathan Bossart <nathandbossart@gmail.com> Reviewed-by: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com> Discussion: https://postgr.es/m/CALj2ACUmL5TraYBUBqDZBi1C+Re8_=SekqGYqYprj_W8wygQ8w@mail.gmail.com
This commit is contained in:
@@ -270,33 +270,6 @@ pg_reload_conf(PG_FUNCTION_ARGS)
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Rotate log file
|
||||
*
|
||||
* This function is kept to support adminpack 1.0.
|
||||
*/
|
||||
Datum
|
||||
pg_rotate_logfile(PG_FUNCTION_ARGS)
|
||||
{
|
||||
if (!superuser())
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
|
||||
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()")));
|
||||
|
||||
if (!Logging_collector)
|
||||
{
|
||||
ereport(WARNING,
|
||||
(errmsg("rotation not possible because log collection not active")));
|
||||
PG_RETURN_BOOL(false);
|
||||
}
|
||||
|
||||
SendPostmasterSignal(PMSIGNAL_ROTATE_LOGFILE);
|
||||
PG_RETURN_BOOL(true);
|
||||
}
|
||||
|
||||
/*
|
||||
* Rotate log file
|
||||
*
|
||||
@@ -304,7 +277,7 @@ pg_rotate_logfile(PG_FUNCTION_ARGS)
|
||||
* GRANT system.
|
||||
*/
|
||||
Datum
|
||||
pg_rotate_logfile_v2(PG_FUNCTION_ARGS)
|
||||
pg_rotate_logfile(PG_FUNCTION_ARGS)
|
||||
{
|
||||
if (!Logging_collector)
|
||||
{
|
||||
|
||||
@@ -227,52 +227,6 @@ read_text_file(const char *filename, int64 seek_offset, int64 bytes_to_read,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* Read a section of a file, returning it as text
|
||||
*
|
||||
* This function is kept to support adminpack 1.0.
|
||||
*/
|
||||
Datum
|
||||
pg_read_file(PG_FUNCTION_ARGS)
|
||||
{
|
||||
text *filename_t = PG_GETARG_TEXT_PP(0);
|
||||
int64 seek_offset = 0;
|
||||
int64 bytes_to_read = -1;
|
||||
bool missing_ok = false;
|
||||
char *filename;
|
||||
text *result;
|
||||
|
||||
if (!superuser())
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
|
||||
errmsg("must be superuser to read files with adminpack 1.0"),
|
||||
/* translator: %s is a SQL function name */
|
||||
errhint("Consider using %s, which is part of core, instead.",
|
||||
"pg_read_file()")));
|
||||
|
||||
/* handle optional arguments */
|
||||
if (PG_NARGS() >= 3)
|
||||
{
|
||||
seek_offset = PG_GETARG_INT64(1);
|
||||
bytes_to_read = PG_GETARG_INT64(2);
|
||||
|
||||
if (bytes_to_read < 0)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
|
||||
errmsg("requested length cannot be negative")));
|
||||
}
|
||||
if (PG_NARGS() >= 4)
|
||||
missing_ok = PG_GETARG_BOOL(3);
|
||||
|
||||
filename = convert_and_check_filename(filename_t);
|
||||
|
||||
result = read_text_file(filename, seek_offset, bytes_to_read, missing_ok);
|
||||
if (result)
|
||||
PG_RETURN_TEXT_P(result);
|
||||
else
|
||||
PG_RETURN_NULL();
|
||||
}
|
||||
|
||||
/*
|
||||
* Read a section of a file, returning it as text
|
||||
*
|
||||
|
||||
@@ -57,6 +57,6 @@
|
||||
*/
|
||||
|
||||
/* yyyymmddN */
|
||||
#define CATALOG_VERSION_NO 202402291
|
||||
#define CATALOG_VERSION_NO 202403041
|
||||
|
||||
#endif
|
||||
|
||||
@@ -6545,9 +6545,6 @@
|
||||
proargtypes => '', prosrc => 'pg_reload_conf' },
|
||||
{ oid => '2622', descr => 'rotate log file',
|
||||
proname => 'pg_rotate_logfile', provolatile => 'v', prorettype => 'bool',
|
||||
proargtypes => '', prosrc => 'pg_rotate_logfile_v2' },
|
||||
{ oid => '4099', descr => 'rotate log file - old version for adminpack 1.0',
|
||||
proname => 'pg_rotate_logfile_old', provolatile => 'v', prorettype => 'bool',
|
||||
proargtypes => '', prosrc => 'pg_rotate_logfile' },
|
||||
{ oid => '3800', descr => 'current logging collector file location',
|
||||
proname => 'pg_current_logfile', proisstrict => 'f', provolatile => 'v',
|
||||
@@ -6578,10 +6575,6 @@
|
||||
proname => 'pg_read_file', provolatile => 'v', prorettype => 'text',
|
||||
proargtypes => 'text int8 int8 bool',
|
||||
prosrc => 'pg_read_file_off_len_missing' },
|
||||
{ oid => '4100',
|
||||
descr => 'read text from a file - old version for adminpack 1.0',
|
||||
proname => 'pg_read_file_old', provolatile => 'v', prorettype => 'text',
|
||||
proargtypes => 'text int8 int8', prosrc => 'pg_read_file' },
|
||||
{ oid => '3826', descr => 'read text from a file',
|
||||
proname => 'pg_read_file', provolatile => 'v', prorettype => 'text',
|
||||
proargtypes => 'text', prosrc => 'pg_read_file_all' },
|
||||
|
||||
Reference in New Issue
Block a user