mirror of https://github.com/citusdata/citus.git
Address review on attstattarget is nullable, define pg compatible functions for it
parent
7497419dc4
commit
ef60a25b87
|
@ -739,11 +739,17 @@ pg_get_tablecolumnoptionsdef_string(Oid tableRelationId)
|
|||
* If the user changed the column's statistics target, create
|
||||
* alter statement and add statement to a list for later processing.
|
||||
*/
|
||||
HeapTuple tp = SearchSysCache2(ATTNUM,
|
||||
HeapTuple atttuple = SearchSysCache2(ATTNUM,
|
||||
ObjectIdGetDatum(tableRelationId),
|
||||
Int16GetDatum(attributeForm->attnum));
|
||||
int32 targetAttstattarget = getAttstattarget_compat(tp);
|
||||
ReleaseSysCache(tp);
|
||||
if (!HeapTupleIsValid(atttuple))
|
||||
{
|
||||
elog(ERROR, "cache lookup failed for attribute %d of relation %u",
|
||||
attributeForm->attnum, tableRelationId);
|
||||
}
|
||||
|
||||
int32 targetAttstattarget = getAttstattarget_compat(atttuple);
|
||||
ReleaseSysCache(atttuple);
|
||||
if (targetAttstattarget >= 0)
|
||||
{
|
||||
StringInfoData statement = { NULL, 0, 0, 0 };
|
||||
|
|
Loading…
Reference in New Issue