1919 {
1920 Oid etype;
1921 Datum *e;
1922 bool *nulls;
1923 int16 typlen;
1924 bool typbyval;
1925 char typalign;
1926 int n = 0;
1927
1928 HeapTupleHeader tup;
1929 bool isnull;
1930 Datum tupv;
1931
1932 int i;
1934 char *utypename = NULL;
1936
1937 etype = ARR_ELEMTYPE(array);
1938 get_typlenbyvalalign(etype, &typlen, &typbyval, &typalign);
1939
1940 deconstruct_array(
1941 array,
1942 etype,
1943 typlen, typbyval, typalign,
1944 &e, &nulls, &n
1945 );
1946
1947 if (!n) {
1948 elog(ERROR, "rtpg_union_unionarg_process: Invalid argument for unionarg");
1949 return 0;
1950 }
1951
1952
1956 elog(ERROR, "rtpg_union_unionarg_process: Could not allocate memory for band information");
1957 return 0;
1958 }
1959
1960
1961 for (i = 0; i < n; i++) {
1962 if (nulls[i]) {
1964 continue;
1965 }
1966
1968
1969
1970 tup = (HeapTupleHeader) DatumGetPointer(e[i]);
1971 if (NULL == tup) {
1972 elog(ERROR, "rtpg_union_unionarg_process: Invalid argument for unionarg");
1973 return 0;
1974 }
1975
1976
1977 tupv = GetAttributeByName(tup, "nband", &isnull);
1978 if (isnull) {
1980 elog(NOTICE, "First argument (nband) of unionarg is NULL. Assuming nband = %d", nband);
1981 }
1982 else
1983 nband = DatumGetInt32(tupv);
1984
1985 if (nband < 1) {
1986 elog(ERROR, "rtpg_union_unionarg_process: Band number must be greater than zero (1-based)");
1987 return 0;
1988 }
1989
1990
1991 tupv = GetAttributeByName(tup, "uniontype", &isnull);
1992 if (isnull) {
1993 elog(NOTICE, "Second argument (uniontype) of unionarg is NULL. Assuming uniontype = LAST");
1995 }
1996 else {
1997 utypename = text_to_cstring((text *) DatumGetPointer(tupv));
1999 }
2000
2004
2005 if (
2008 ) {
2010 }
2011 else
2013 }
2014
2018 elog(ERROR, "rtpg_union_unionarg_process: Could not reallocate memory for band information");
2019 return 0;
2020 }
2021 }
2022
2023 return 1;
2024}
char * rtpg_strtoupper(char *str)
static rtpg_union_type rtpg_uniontype_index_from_name(const char *cutype)
#define POSTGIS_RT_DEBUGF(level, msg,...)
rtpg_union_band_arg bandarg
rtpg_union_type uniontype