Master apache

Changes for throwing exception for queries with upsert select with specific index.
Tries not to set the maxlength in column def for array type as we don't really know the actual maxlength for arrays during definition.