提交 42b53fe4 编写于 作者: H Heikki Linnakangas

Remove unused function.

The code in InitPostgres() was refactored in PostgreSQL 9.0 so that it
no longer uses FindMyDatabaseByOid() function. We had backpatched the
InitPostgres() changes already, so backpatch the removal of
FindMyDatabaseByOid() as well. Silences a compiler warning.
上级 f9a020e1
......@@ -315,48 +315,6 @@ ProcessRoleGUC(void)
caql_endscan(pcqCtx);
}
/*
* FindMyDatabaseByOid
*
* As above, but the actual database Id is known. Return its name and the
* tablespace OID. Return TRUE if found, FALSE if not. The same restrictions
* as FindMyDatabase apply.
*/
static bool
FindMyDatabaseByOid(Oid dbid, char *dbname, Oid *db_tablespace)
{
bool result = false;
char *filename;
FILE *db_file;
Oid db_id;
char thisname[NAMEDATALEN];
TransactionId db_frozenxid;
filename = database_getflatfilename();
db_file = AllocateFile(filename, "r");
if (db_file == NULL)
ereport(FATAL,
(errcode_for_file_access(),
errmsg("could not open file \"%s\": %m", filename)));
while (read_pg_database_line(db_file, thisname, &db_id,
db_tablespace, &db_frozenxid))
{
if (dbid == db_id)
{
result = true;
strlcpy(dbname, thisname, NAMEDATALEN);
break;
}
}
FreeFile(db_file);
pfree(filename);
return result;
}
/*
* CheckMyDatabase -- fetch information from the pg_database entry for our DB
*/
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册