1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-14 18:42:34 +03:00

Add FOREACH IN ARRAY looping to plpgsql.

(I'm not entirely sure that we've finished bikeshedding the syntax details,
but the functionality seems OK.)

Pavel Stehule, reviewed by Stephen Frost and Tom Lane
This commit is contained in:
Tom Lane
2011-02-16 01:52:04 -05:00
parent 4695da5ae9
commit 6e02755b22
10 changed files with 899 additions and 15 deletions

View File

@ -114,6 +114,9 @@ typedef struct ArrayMapState
ArrayMetaState ret_extra;
} ArrayMapState;
/* ArrayIteratorData is private in arrayfuncs.c */
typedef struct ArrayIteratorData *ArrayIterator;
/*
* fmgr macros for array objects
*/
@ -254,6 +257,10 @@ extern Datum makeArrayResult(ArrayBuildState *astate,
extern Datum makeMdArrayResult(ArrayBuildState *astate, int ndims,
int *dims, int *lbs, MemoryContext rcontext, bool release);
extern ArrayIterator array_create_iterator(ArrayType *arr, int slice_ndim);
extern bool array_iterate(ArrayIterator iterator, Datum *value, bool *isnull);
extern void array_free_iterator(ArrayIterator iterator);
/*
* prototypes for functions defined in arrayutils.c
*/