diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2000-08-03 19:19:38 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2000-08-03 19:19:38 +0000 |
commit | 61aca818c486dbe000ce94c77cb1dd1f379baf67 (patch) | |
tree | 6d266f3253db8cb2ea9d59bb63dff89f8f7a1c56 /src/backend/bootstrap/bootstrap.c | |
parent | c298d74d4957845bb03a67092c30b53e5e0d01c2 (diff) | |
download | postgresql-61aca818c486dbe000ce94c77cb1dd1f379baf67.tar.gz postgresql-61aca818c486dbe000ce94c77cb1dd1f379baf67.zip |
Modify heap_open()/heap_openr() API per pghackers discussion of 11 July.
These two routines will now ALWAYS elog() on failure, whether you ask for
a lock or not. If you really want to get a NULL return on failure, call
the new routines heap_open_nofail()/heap_openr_nofail(). By my count there
are only about three places that actually want that behavior. There were
rather more than three places that were missing the check they needed to
make under the old convention :-(.
Diffstat (limited to 'src/backend/bootstrap/bootstrap.c')
-rw-r--r-- | src/backend/bootstrap/bootstrap.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/src/backend/bootstrap/bootstrap.c b/src/backend/bootstrap/bootstrap.c index c3cf9371724..2eacad23dc3 100644 --- a/src/backend/bootstrap/bootstrap.c +++ b/src/backend/bootstrap/bootstrap.c @@ -8,7 +8,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.91 2000/07/14 22:17:38 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.92 2000/08/03 19:19:06 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -430,7 +430,6 @@ boot_openrel(char *relname) if (Typ == (struct typmap **) NULL) { rel = heap_openr(TypeRelationName, NoLock); - Assert(rel); scan = heap_beginscan(rel, 0, SnapshotNow, 0, (ScanKey) NULL); i = 0; while (HeapTupleIsValid(tup = heap_getnext(scan, 0))) @@ -462,7 +461,6 @@ boot_openrel(char *relname) (int) ATTRIBUTE_TUPLE_SIZE); reldesc = heap_openr(relname, NoLock); - Assert(reldesc); numattr = reldesc->rd_rel->relnatts; for (i = 0; i < numattr; i++) { @@ -822,7 +820,6 @@ gettype(char *type) if (DebugMode) printf("bootstrap.c: External Type: %s\n", type); rel = heap_openr(TypeRelationName, NoLock); - Assert(rel); scan = heap_beginscan(rel, 0, SnapshotNow, 0, (ScanKey) NULL); i = 0; while (HeapTupleIsValid(tup = heap_getnext(scan, 0))) @@ -1116,9 +1113,7 @@ build_indices() Relation ind; heap = heap_openr(ILHead->il_heap, NoLock); - Assert(heap); ind = index_openr(ILHead->il_ind); - Assert(ind); index_build(heap, ind, ILHead->il_info, NULL); /* |