| 1759 | |
| 1760 | |
| 1761 | static ArrayType * |
| 1762 | ConvertUint64ListToArray(List *collectionIdArray) |
| 1763 | { |
| 1764 | int numCollections = list_length(collectionIdArray); |
| 1765 | Datum *collectionIdDatums = palloc0(sizeof(Datum) * numCollections); |
| 1766 | |
| 1767 | int i = 0; |
| 1768 | uint64 collectionId; |
| 1769 | ListCell *cell; |
| 1770 | foreach(cell, collectionIdArray) |
| 1771 | { |
| 1772 | collectionId = *(uint64 *) lfirst(cell); |
| 1773 | collectionIdDatums[i] = Int64GetDatum(collectionId); |
| 1774 | i++; |
| 1775 | } |
| 1776 | |
| 1777 | ArrayType *collectionIdArrayDatum = construct_array(collectionIdDatums, |
| 1778 | numCollections, |
| 1779 | INT8OID, |
| 1780 | sizeof(uint64), true, |
| 1781 | TYPALIGN_INT); |
| 1782 | return collectionIdArrayDatum; |
| 1783 | } |
| 1784 | |
| 1785 | |
| 1786 | /* |
no test coverage detected