summaryrefslogtreecommitdiff
path: root/src/pl/plpython/sql/plpython_setof.sql
blob: 6e157886728ba721ffc0c9b03cf2d32fcf62ef6e (plain)
1
2
3
4
5
6
7
8
9
10
11
12

CREATE or replace FUNCTION test_setof() returns setof text
	AS
'if GD.has_key("calls"):
	GD["calls"] = GD["calls"] + 1
	if GD["calls"] > 2:
		del GD["calls"]
		return plpy.EndOfSet
else:
	GD["calls"] = 1
return str(GD["calls"])'
	LANGUAGE plpythonu;