From a8bb8eb58334e26eac0aa8d2db499a70e22b39d7 Mon Sep 17 00:00:00 2001 From: Alvaro Herrera Date: Tue, 1 Sep 2009 02:54:52 +0000 Subject: Remove flatfiles.c, which is now obsolete. Recent commits have removed the various uses it was supporting. It was a performance bottleneck, according to bug report #4919 by Lauris Ulmanis; seems it slowed down user creation after a billion users. --- src/backend/libpq/hba.c | 47 +---------------------------------------------- 1 file changed, 1 insertion(+), 46 deletions(-) (limited to 'src/backend/libpq/hba.c') diff --git a/src/backend/libpq/hba.c b/src/backend/libpq/hba.c index dbd61916823..77fe11f05a7 100644 --- a/src/backend/libpq/hba.c +++ b/src/backend/libpq/hba.c @@ -10,7 +10,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/libpq/hba.c,v 1.189 2009/08/29 19:26:51 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/libpq/hba.c,v 1.190 2009/09/01 02:54:51 alvherre Exp $ * *------------------------------------------------------------------------- */ @@ -1274,51 +1274,6 @@ load_hba(void) return true; } -/* - * Read and parse one line from the flat pg_database file. - * - * Returns TRUE on success, FALSE if EOF; bad data causes elog(FATAL). - * - * Output parameters: - * dbname: gets database name (must be of size NAMEDATALEN bytes) - * dboid: gets database OID - * dbtablespace: gets database's default tablespace's OID - * dbfrozenxid: gets database's frozen XID - * - * This is not much related to the other functions in hba.c, but we put it - * here because it uses the next_token() infrastructure. - */ -bool -read_pg_database_line(FILE *fp, char *dbname, Oid *dboid, - Oid *dbtablespace, TransactionId *dbfrozenxid) -{ - char buf[MAX_TOKEN]; - - if (feof(fp)) - return false; - if (!next_token(fp, buf, sizeof(buf))) - return false; - if (strlen(buf) >= NAMEDATALEN) - elog(FATAL, "bad data in flat pg_database file"); - strcpy(dbname, buf); - next_token(fp, buf, sizeof(buf)); - if (!isdigit((unsigned char) buf[0])) - elog(FATAL, "bad data in flat pg_database file"); - *dboid = atooid(buf); - next_token(fp, buf, sizeof(buf)); - if (!isdigit((unsigned char) buf[0])) - elog(FATAL, "bad data in flat pg_database file"); - *dbtablespace = atooid(buf); - next_token(fp, buf, sizeof(buf)); - if (!isdigit((unsigned char) buf[0])) - elog(FATAL, "bad data in flat pg_database file"); - *dbfrozenxid = atoxid(buf); - /* expect EOL next */ - if (next_token(fp, buf, sizeof(buf))) - elog(FATAL, "bad data in flat pg_database file"); - return true; -} - /* * Process one line from the ident config file. * -- cgit v1.2.3