mirror of
				https://github.com/postgres/postgres.git
				synced 2025-10-31 10:30:33 +03:00 
			
		
		
		
	Add missing Datum conversions
Add various missing conversions from and to Datum. The previous code mostly relied on implicit conversions or its own explicit casts instead of using the correct DatumGet*() or *GetDatum() functions. We think these omissions are harmless. Some actual bugs that were discovered during this process have been committed separately (80c758a2e1,fd2ab03fea). Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://www.postgresql.org/message-id/flat/8246d7ff-f4b7-4363-913e-827dadfeb145%40eisentraut.org
This commit is contained in:
		| @@ -638,7 +638,7 @@ CreateSubscription(ParseState *pstate, CreateSubscriptionStmt *stmt, | ||||
|  | ||||
| 	/* Check if name is used */ | ||||
| 	subid = GetSysCacheOid2(SUBSCRIPTIONNAME, Anum_pg_subscription_oid, | ||||
| 							MyDatabaseId, CStringGetDatum(stmt->subname)); | ||||
| 							ObjectIdGetDatum(MyDatabaseId), CStringGetDatum(stmt->subname)); | ||||
| 	if (OidIsValid(subid)) | ||||
| 	{ | ||||
| 		ereport(ERROR, | ||||
| @@ -1185,7 +1185,7 @@ AlterSubscription(ParseState *pstate, AlterSubscriptionStmt *stmt, | ||||
| 	rel = table_open(SubscriptionRelationId, RowExclusiveLock); | ||||
|  | ||||
| 	/* Fetch the existing tuple. */ | ||||
| 	tup = SearchSysCacheCopy2(SUBSCRIPTIONNAME, MyDatabaseId, | ||||
| 	tup = SearchSysCacheCopy2(SUBSCRIPTIONNAME, ObjectIdGetDatum(MyDatabaseId), | ||||
| 							  CStringGetDatum(stmt->subname)); | ||||
|  | ||||
| 	if (!HeapTupleIsValid(tup)) | ||||
| @@ -1808,7 +1808,7 @@ DropSubscription(DropSubscriptionStmt *stmt, bool isTopLevel) | ||||
| 	 */ | ||||
| 	rel = table_open(SubscriptionRelationId, AccessExclusiveLock); | ||||
|  | ||||
| 	tup = SearchSysCache2(SUBSCRIPTIONNAME, MyDatabaseId, | ||||
| 	tup = SearchSysCache2(SUBSCRIPTIONNAME, ObjectIdGetDatum(MyDatabaseId), | ||||
| 						  CStringGetDatum(stmt->subname)); | ||||
|  | ||||
| 	if (!HeapTupleIsValid(tup)) | ||||
| @@ -2193,7 +2193,7 @@ AlterSubscriptionOwner(const char *name, Oid newOwnerId) | ||||
|  | ||||
| 	rel = table_open(SubscriptionRelationId, RowExclusiveLock); | ||||
|  | ||||
| 	tup = SearchSysCacheCopy2(SUBSCRIPTIONNAME, MyDatabaseId, | ||||
| 	tup = SearchSysCacheCopy2(SUBSCRIPTIONNAME, ObjectIdGetDatum(MyDatabaseId), | ||||
| 							  CStringGetDatum(name)); | ||||
|  | ||||
| 	if (!HeapTupleIsValid(tup)) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user