mirror of
https://github.com/postgres/postgres.git
synced 2025-04-29 13:56:47 +03:00
Remove 'datlastsysoid'.
It hasn't been used for anything for a long time. Up until recently, we still queried it when dumping very old servers, but since commit 30e7c175b81d53c0f60f6ad12d1913a6d7d77008, there's no longer any code at all that cares about it. Discussion: http://postgr.es/m/CA+Tgmoa14=BRq0WEd0eevjEMn9EkghDB1FZEkBw7+UAb7tF49A@mail.gmail.com
This commit is contained in:
parent
b700f96cff
commit
ab4fd4f868
@ -183,7 +183,7 @@
|
|||||||
descr => 'database\'s default template',
|
descr => 'database\'s default template',
|
||||||
datname => 'template1', encoding => 'ENCODING', datcollate => 'LC_COLLATE',
|
datname => 'template1', encoding => 'ENCODING', datcollate => 'LC_COLLATE',
|
||||||
datctype => 'LC_CTYPE', datistemplate => 't', datallowconn => 't',
|
datctype => 'LC_CTYPE', datistemplate => 't', datallowconn => 't',
|
||||||
datconnlimit => '-1', datlastsysoid => '0', datfrozenxid => '0',
|
datconnlimit => '-1', datfrozenxid => '0',
|
||||||
datminmxid => '1', dattablespace => 'pg_default', datacl => '_null_' },
|
datminmxid => '1', dattablespace => 'pg_default', datacl => '_null_' },
|
||||||
|
|
||||||
]
|
]
|
||||||
|
@ -3001,16 +3001,6 @@ SCRAM-SHA-256$<replaceable><iteration count></replaceable>:<replaceable>&l
|
|||||||
</para></entry>
|
</para></entry>
|
||||||
</row>
|
</row>
|
||||||
|
|
||||||
<row>
|
|
||||||
<entry role="catalog_table_entry"><para role="column_definition">
|
|
||||||
<structfield>datlastsysoid</structfield> <type>oid</type>
|
|
||||||
</para>
|
|
||||||
<para>
|
|
||||||
Last system OID in the database; useful
|
|
||||||
particularly to <application>pg_dump</application>
|
|
||||||
</para></entry>
|
|
||||||
</row>
|
|
||||||
|
|
||||||
<row>
|
<row>
|
||||||
<entry role="catalog_table_entry"><para role="column_definition">
|
<entry role="catalog_table_entry"><para role="column_definition">
|
||||||
<structfield>datfrozenxid</structfield> <type>xid</type>
|
<structfield>datfrozenxid</structfield> <type>xid</type>
|
||||||
|
@ -4732,7 +4732,6 @@ encoding = 0 (type: 5)
|
|||||||
datistemplate = t (type: 1)
|
datistemplate = t (type: 1)
|
||||||
datallowconn = t (type: 1)
|
datallowconn = t (type: 1)
|
||||||
datconnlimit = -1 (type: 5)
|
datconnlimit = -1 (type: 5)
|
||||||
datlastsysoid = 11510 (type: 1)
|
|
||||||
datfrozenxid = 379 (type: 1)
|
datfrozenxid = 379 (type: 1)
|
||||||
dattablespace = 1663 (type: 1)
|
dattablespace = 1663 (type: 1)
|
||||||
datconfig = (type: 1)
|
datconfig = (type: 1)
|
||||||
@ -4757,7 +4756,6 @@ encoding = 0 (type: 5)
|
|||||||
datistemplate = f (type: 1)
|
datistemplate = f (type: 1)
|
||||||
datallowconn = t (type: 1)
|
datallowconn = t (type: 1)
|
||||||
datconnlimit = -1 (type: 5)
|
datconnlimit = -1 (type: 5)
|
||||||
datlastsysoid = 11510 (type: 1)
|
|
||||||
datfrozenxid = 379 (type: 1)
|
datfrozenxid = 379 (type: 1)
|
||||||
dattablespace = 1663 (type: 1)
|
dattablespace = 1663 (type: 1)
|
||||||
datconfig = (type: 1)
|
datconfig = (type: 1)
|
||||||
|
@ -84,8 +84,7 @@ static void movedb_failure_callback(int code, Datum arg);
|
|||||||
static bool get_db_info(const char *name, LOCKMODE lockmode,
|
static bool get_db_info(const char *name, LOCKMODE lockmode,
|
||||||
Oid *dbIdP, Oid *ownerIdP,
|
Oid *dbIdP, Oid *ownerIdP,
|
||||||
int *encodingP, bool *dbIsTemplateP, bool *dbAllowConnP,
|
int *encodingP, bool *dbIsTemplateP, bool *dbAllowConnP,
|
||||||
Oid *dbLastSysOidP, TransactionId *dbFrozenXidP,
|
TransactionId *dbFrozenXidP, MultiXactId *dbMinMultiP,
|
||||||
MultiXactId *dbMinMultiP,
|
|
||||||
Oid *dbTablespace, char **dbCollate, char **dbCtype);
|
Oid *dbTablespace, char **dbCollate, char **dbCtype);
|
||||||
static bool have_createdb_privilege(void);
|
static bool have_createdb_privilege(void);
|
||||||
static void remove_dbtablespaces(Oid db_id);
|
static void remove_dbtablespaces(Oid db_id);
|
||||||
@ -108,7 +107,6 @@ createdb(ParseState *pstate, const CreatedbStmt *stmt)
|
|||||||
char *src_ctype = NULL;
|
char *src_ctype = NULL;
|
||||||
bool src_istemplate;
|
bool src_istemplate;
|
||||||
bool src_allowconn;
|
bool src_allowconn;
|
||||||
Oid src_lastsysoid = InvalidOid;
|
|
||||||
TransactionId src_frozenxid = InvalidTransactionId;
|
TransactionId src_frozenxid = InvalidTransactionId;
|
||||||
MultiXactId src_minmxid = InvalidMultiXactId;
|
MultiXactId src_minmxid = InvalidMultiXactId;
|
||||||
Oid src_deftablespace;
|
Oid src_deftablespace;
|
||||||
@ -318,7 +316,7 @@ createdb(ParseState *pstate, const CreatedbStmt *stmt)
|
|||||||
|
|
||||||
if (!get_db_info(dbtemplate, ShareLock,
|
if (!get_db_info(dbtemplate, ShareLock,
|
||||||
&src_dboid, &src_owner, &src_encoding,
|
&src_dboid, &src_owner, &src_encoding,
|
||||||
&src_istemplate, &src_allowconn, &src_lastsysoid,
|
&src_istemplate, &src_allowconn,
|
||||||
&src_frozenxid, &src_minmxid, &src_deftablespace,
|
&src_frozenxid, &src_minmxid, &src_deftablespace,
|
||||||
&src_collate, &src_ctype))
|
&src_collate, &src_ctype))
|
||||||
ereport(ERROR,
|
ereport(ERROR,
|
||||||
@ -532,7 +530,6 @@ createdb(ParseState *pstate, const CreatedbStmt *stmt)
|
|||||||
new_record[Anum_pg_database_datistemplate - 1] = BoolGetDatum(dbistemplate);
|
new_record[Anum_pg_database_datistemplate - 1] = BoolGetDatum(dbistemplate);
|
||||||
new_record[Anum_pg_database_datallowconn - 1] = BoolGetDatum(dballowconnections);
|
new_record[Anum_pg_database_datallowconn - 1] = BoolGetDatum(dballowconnections);
|
||||||
new_record[Anum_pg_database_datconnlimit - 1] = Int32GetDatum(dbconnlimit);
|
new_record[Anum_pg_database_datconnlimit - 1] = Int32GetDatum(dbconnlimit);
|
||||||
new_record[Anum_pg_database_datlastsysoid - 1] = ObjectIdGetDatum(src_lastsysoid);
|
|
||||||
new_record[Anum_pg_database_datfrozenxid - 1] = TransactionIdGetDatum(src_frozenxid);
|
new_record[Anum_pg_database_datfrozenxid - 1] = TransactionIdGetDatum(src_frozenxid);
|
||||||
new_record[Anum_pg_database_datminmxid - 1] = TransactionIdGetDatum(src_minmxid);
|
new_record[Anum_pg_database_datminmxid - 1] = TransactionIdGetDatum(src_minmxid);
|
||||||
new_record[Anum_pg_database_dattablespace - 1] = ObjectIdGetDatum(dst_deftablespace);
|
new_record[Anum_pg_database_dattablespace - 1] = ObjectIdGetDatum(dst_deftablespace);
|
||||||
@ -802,7 +799,7 @@ dropdb(const char *dbname, bool missing_ok, bool force)
|
|||||||
pgdbrel = table_open(DatabaseRelationId, RowExclusiveLock);
|
pgdbrel = table_open(DatabaseRelationId, RowExclusiveLock);
|
||||||
|
|
||||||
if (!get_db_info(dbname, AccessExclusiveLock, &db_id, NULL, NULL,
|
if (!get_db_info(dbname, AccessExclusiveLock, &db_id, NULL, NULL,
|
||||||
&db_istemplate, NULL, NULL, NULL, NULL, NULL, NULL, NULL))
|
&db_istemplate, NULL, NULL, NULL, NULL, NULL, NULL))
|
||||||
{
|
{
|
||||||
if (!missing_ok)
|
if (!missing_ok)
|
||||||
{
|
{
|
||||||
@ -1001,7 +998,7 @@ RenameDatabase(const char *oldname, const char *newname)
|
|||||||
rel = table_open(DatabaseRelationId, RowExclusiveLock);
|
rel = table_open(DatabaseRelationId, RowExclusiveLock);
|
||||||
|
|
||||||
if (!get_db_info(oldname, AccessExclusiveLock, &db_id, NULL, NULL,
|
if (!get_db_info(oldname, AccessExclusiveLock, &db_id, NULL, NULL,
|
||||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL))
|
NULL, NULL, NULL, NULL, NULL, NULL, NULL))
|
||||||
ereport(ERROR,
|
ereport(ERROR,
|
||||||
(errcode(ERRCODE_UNDEFINED_DATABASE),
|
(errcode(ERRCODE_UNDEFINED_DATABASE),
|
||||||
errmsg("database \"%s\" does not exist", oldname)));
|
errmsg("database \"%s\" does not exist", oldname)));
|
||||||
@ -1114,7 +1111,7 @@ movedb(const char *dbname, const char *tblspcname)
|
|||||||
pgdbrel = table_open(DatabaseRelationId, RowExclusiveLock);
|
pgdbrel = table_open(DatabaseRelationId, RowExclusiveLock);
|
||||||
|
|
||||||
if (!get_db_info(dbname, AccessExclusiveLock, &db_id, NULL, NULL,
|
if (!get_db_info(dbname, AccessExclusiveLock, &db_id, NULL, NULL,
|
||||||
NULL, NULL, NULL, NULL, NULL, &src_tblspcoid, NULL, NULL))
|
NULL, NULL, NULL, NULL, &src_tblspcoid, NULL, NULL))
|
||||||
ereport(ERROR,
|
ereport(ERROR,
|
||||||
(errcode(ERRCODE_UNDEFINED_DATABASE),
|
(errcode(ERRCODE_UNDEFINED_DATABASE),
|
||||||
errmsg("database \"%s\" does not exist", dbname)));
|
errmsg("database \"%s\" does not exist", dbname)));
|
||||||
@ -1757,8 +1754,7 @@ static bool
|
|||||||
get_db_info(const char *name, LOCKMODE lockmode,
|
get_db_info(const char *name, LOCKMODE lockmode,
|
||||||
Oid *dbIdP, Oid *ownerIdP,
|
Oid *dbIdP, Oid *ownerIdP,
|
||||||
int *encodingP, bool *dbIsTemplateP, bool *dbAllowConnP,
|
int *encodingP, bool *dbIsTemplateP, bool *dbAllowConnP,
|
||||||
Oid *dbLastSysOidP, TransactionId *dbFrozenXidP,
|
TransactionId *dbFrozenXidP, MultiXactId *dbMinMultiP,
|
||||||
MultiXactId *dbMinMultiP,
|
|
||||||
Oid *dbTablespace, char **dbCollate, char **dbCtype)
|
Oid *dbTablespace, char **dbCollate, char **dbCtype)
|
||||||
{
|
{
|
||||||
bool result = false;
|
bool result = false;
|
||||||
@ -1839,9 +1835,6 @@ get_db_info(const char *name, LOCKMODE lockmode,
|
|||||||
/* allowing connections? */
|
/* allowing connections? */
|
||||||
if (dbAllowConnP)
|
if (dbAllowConnP)
|
||||||
*dbAllowConnP = dbform->datallowconn;
|
*dbAllowConnP = dbform->datallowconn;
|
||||||
/* last system OID used in database */
|
|
||||||
if (dbLastSysOidP)
|
|
||||||
*dbLastSysOidP = dbform->datlastsysoid;
|
|
||||||
/* limit of frozen XIDs */
|
/* limit of frozen XIDs */
|
||||||
if (dbFrozenXidP)
|
if (dbFrozenXidP)
|
||||||
*dbFrozenXidP = dbform->datfrozenxid;
|
*dbFrozenXidP = dbform->datfrozenxid;
|
||||||
|
@ -1841,13 +1841,6 @@ make_template0(FILE *cmdfd)
|
|||||||
static const char *const template0_setup[] = {
|
static const char *const template0_setup[] = {
|
||||||
"CREATE DATABASE template0 IS_TEMPLATE = true ALLOW_CONNECTIONS = false;\n\n",
|
"CREATE DATABASE template0 IS_TEMPLATE = true ALLOW_CONNECTIONS = false;\n\n",
|
||||||
|
|
||||||
/*
|
|
||||||
* We use the OID of template0 to determine datlastsysoid
|
|
||||||
*/
|
|
||||||
"UPDATE pg_database SET datlastsysoid = "
|
|
||||||
" (SELECT oid FROM pg_database "
|
|
||||||
" WHERE datname = 'template0');\n\n",
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Explicitly revoke public create-schema and create-temp-table
|
* Explicitly revoke public create-schema and create-temp-table
|
||||||
* privileges in template1 and template0; else the latter would be on
|
* privileges in template1 and template0; else the latter would be on
|
||||||
|
@ -53,6 +53,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/* yyyymmddN */
|
/* yyyymmddN */
|
||||||
#define CATALOG_VERSION_NO 202201191
|
#define CATALOG_VERSION_NO 202201201
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
descr => 'default template for new databases',
|
descr => 'default template for new databases',
|
||||||
datname => 'template1', encoding => 'ENCODING', datcollate => 'LC_COLLATE',
|
datname => 'template1', encoding => 'ENCODING', datcollate => 'LC_COLLATE',
|
||||||
datctype => 'LC_CTYPE', datistemplate => 't', datallowconn => 't',
|
datctype => 'LC_CTYPE', datistemplate => 't', datallowconn => 't',
|
||||||
datconnlimit => '-1', datlastsysoid => '0', datfrozenxid => '0',
|
datconnlimit => '-1', datfrozenxid => '0',
|
||||||
datminmxid => '1', dattablespace => 'pg_default', datacl => '_null_' },
|
datminmxid => '1', dattablespace => 'pg_default', datacl => '_null_' },
|
||||||
|
|
||||||
]
|
]
|
||||||
|
@ -55,9 +55,6 @@ CATALOG(pg_database,1262,DatabaseRelationId) BKI_SHARED_RELATION BKI_ROWTYPE_OID
|
|||||||
/* max connections allowed (-1=no limit) */
|
/* max connections allowed (-1=no limit) */
|
||||||
int32 datconnlimit;
|
int32 datconnlimit;
|
||||||
|
|
||||||
/* highest OID to consider a system OID */
|
|
||||||
Oid datlastsysoid;
|
|
||||||
|
|
||||||
/* all Xids < this are frozen in this DB */
|
/* all Xids < this are frozen in this DB */
|
||||||
TransactionId datfrozenxid;
|
TransactionId datfrozenxid;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user