217 |
PG_FUNCTION_INFO_V1(pgswish2); |
PG_FUNCTION_INFO_V1(pgswish2); |
218 |
Datum pgswish2(PG_FUNCTION_ARGS) |
Datum pgswish2(PG_FUNCTION_ARGS) |
219 |
{ |
{ |
|
int ncols = 2; |
|
220 |
int nrows = 3; |
int nrows = 3; |
221 |
int16 typlen; |
int16 typlen; |
222 |
bool typbyval; |
bool typbyval; |
230 |
MemoryContext oldcontext; |
MemoryContext oldcontext; |
231 |
Datum dvalue; |
Datum dvalue; |
232 |
char **values; |
char **values; |
233 |
int rsinfo_ncols; |
int ncols; |
234 |
int i, j; |
int i, j; |
235 |
|
|
236 |
/* check to see if caller supports us returning a tuplestore */ |
/* check to see if caller supports us returning a tuplestore */ |
242 |
|
|
243 |
/* get the requested return tuple description */ |
/* get the requested return tuple description */ |
244 |
tupdesc = rsinfo->expectedDesc; |
tupdesc = rsinfo->expectedDesc; |
245 |
rsinfo_ncols = tupdesc->natts; |
ncols = tupdesc->natts; |
246 |
|
|
247 |
/* |
/* |
248 |
* The requested tuple description better match up with the array |
* The requested tuple description better match up with the array |
249 |
* we were given. |
* we were given. |
250 |
*/ |
*/ |
|
elog(INFO, "rsinfo_ncols = %d, ncols = %d", rsinfo_ncols, ncols); |
|
|
|
|
251 |
/* OK, use it */ |
/* OK, use it */ |
252 |
attinmeta = TupleDescGetAttInMetadata(tupdesc); |
attinmeta = TupleDescGetAttInMetadata(tupdesc); |
253 |
|
|