From 61aca818c486dbe000ce94c77cb1dd1f379baf67 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Thu, 3 Aug 2000 19:19:38 +0000 Subject: 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 :-(. --- src/backend/commands/command.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/backend/commands/command.c') diff --git a/src/backend/commands/command.c b/src/backend/commands/command.c index 3deea360e0a..de2597bd266 100644 --- a/src/backend/commands/command.c +++ b/src/backend/commands/command.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.92 2000/08/03 16:34:01 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.93 2000/08/03 19:19:18 tgl Exp $ * * NOTES * The PerformAddAttribute() code, like most of the relation @@ -1614,8 +1614,6 @@ LockTableCommand(LockStmt *lockstmt) int aclresult; rel = heap_openr(lockstmt->relname, NoLock); - if (!RelationIsValid(rel)) - elog(ERROR, "Relation '%s' does not exist", lockstmt->relname); if (lockstmt->mode == AccessShareLock) aclresult = pg_aclcheck(lockstmt->relname, GetPgUserName(), ACL_RD); -- cgit v1.2.3