diff --git a/src/backend/utils/init/postinit.c b/src/backend/utils/init/postinit.c index 836037086b70422a86fccd66a5a9957b0c10b3c6..1f21e9e892f6bb9dbab44b1bffa6f73f9cbd946d 100644 --- a/src/backend/utils/init/postinit.c +++ b/src/backend/utils/init/postinit.c @@ -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 */