mirror of
				https://github.com/postgres/postgres.git
				synced 2025-11-03 09:13:20 +03:00 
			
		
		
		
	Fix DROP OPERATOR FAMILY IF EXISTS.
Essentially, the "IF EXISTS" portion was being ignored, and an error thrown anyway if the opfamily did not exist. I broke this in commit fd1843ff8979c0461fb3f1a9eab61140c977e32d; so backpatch to 9.1.X. Report and diagnosis by KaiGai Kohei.
This commit is contained in:
		@@ -1614,9 +1614,8 @@ RemoveOpFamily(RemoveOpFamilyStmt *stmt)
 | 
				
			|||||||
	tuple = OpFamilyCacheLookup(amID, stmt->opfamilyname, stmt->missing_ok);
 | 
						tuple = OpFamilyCacheLookup(amID, stmt->opfamilyname, stmt->missing_ok);
 | 
				
			||||||
	if (!HeapTupleIsValid(tuple))
 | 
						if (!HeapTupleIsValid(tuple))
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		ereport(ERROR,
 | 
							ereport(NOTICE,
 | 
				
			||||||
				(errcode(ERRCODE_UNDEFINED_OBJECT),
 | 
									(errmsg("operator family \"%s\" does not exist for access method \"%s\", skipping",
 | 
				
			||||||
				 errmsg("operator family \"%s\" does not exist for access method \"%s\"",
 | 
					 | 
				
			||||||
				   NameListToString(stmt->opfamilyname), stmt->amname)));
 | 
									   NameListToString(stmt->opfamilyname), stmt->amname)));
 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user