static bool create_function_stmts_walker()

in src/pg_query_parse_plpgsql.c [353:384]


static bool create_function_stmts_walker(Node *node, createFunctionStmts *state)
{
	bool result;

	if (node == NULL) return false;

	if (IsA(node, CreateFunctionStmt))
	{
		if (state->stmts_count >= state->stmts_buf_size)
		{
			state->stmts_buf_size *= 2;
			state->stmts = (CreateFunctionStmt**) repalloc(state->stmts, state->stmts_buf_size * sizeof(CreateFunctionStmt*));
		}
		state->stmts[state->stmts_count] = (CreateFunctionStmt *) node;
		state->stmts_count++;
	} else if (IsA(node, RawStmt)) {
		return create_function_stmts_walker((Node *) ((RawStmt *) node)->stmt, state);
	}

	PG_TRY();
	{
		result = raw_expression_tree_walker(node, create_function_stmts_walker, (void*) state);
	}
	PG_CATCH();
	{
		FlushErrorState();
		result = false;
	}
	PG_END_TRY();

	return result;
}