getIdentitySequence(Oid relid, AttrNumber attnum, bool missing_ok)
{
	List	   *seqlist = getOwnedSequences_internal(relid, attnum, DEPENDENCY_INTERNAL);

	if (list_length(seqlist) > 1)
		elog(ERROR, "more than one owned sequence found");
	else if (list_length(seqlist) < 1)
	{
		if (missing_ok)
			return InvalidOid;
		else
			elog(ERROR, "no owned sequence found");
	}

	return linitial_oid(seqlist);
}
getIdentitySequence(Oid relid, AttrNumber attnum, bool missing_ok)
{
	List	   *seqlist = getOwnedSequences_internal(relid, attnum, DEPENDENCY_INTERNAL);

	if (list_length(seqlist) > 1)
		elog(ERROR, "more than one owned sequence found");
	else if (list_length(seqlist) < 1)
	{
		if (missing_ok)
			return InvalidOid;
		else
			elog(ERROR, "no owned sequence found");
	}

	return linitial_oid(seqlist);
}