diff options
Diffstat (limited to 'src/pl/plpython/expected/plpython_spi.out')
-rw-r--r-- | src/pl/plpython/expected/plpython_spi.out | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/src/pl/plpython/expected/plpython_spi.out b/src/pl/plpython/expected/plpython_spi.out index a09df68c7d1..8853e2540d3 100644 --- a/src/pl/plpython/expected/plpython_spi.out +++ b/src/pl/plpython/expected/plpython_spi.out @@ -6,17 +6,17 @@ CREATE FUNCTION nested_call_one(a text) RETURNS text 'q = "SELECT nested_call_two(''%s'')" % a r = plpy.execute(q) return r[0]' - LANGUAGE plpythonu ; + LANGUAGE plpython3u ; CREATE FUNCTION nested_call_two(a text) RETURNS text AS 'q = "SELECT nested_call_three(''%s'')" % a r = plpy.execute(q) return r[0]' - LANGUAGE plpythonu ; + LANGUAGE plpython3u ; CREATE FUNCTION nested_call_three(a text) RETURNS text AS 'return a' - LANGUAGE plpythonu ; + LANGUAGE plpython3u ; -- some spi stuff CREATE FUNCTION spi_prepared_plan_test_one(a text) RETURNS text AS @@ -30,7 +30,7 @@ except Exception as ex: plpy.error(str(ex)) return None ' - LANGUAGE plpythonu; + LANGUAGE plpython3u; CREATE FUNCTION spi_prepared_plan_test_two(a text) RETURNS text AS 'if "myplan" not in SD: @@ -43,7 +43,7 @@ except Exception as ex: plpy.error(str(ex)) return None ' - LANGUAGE plpythonu; + LANGUAGE plpython3u; CREATE FUNCTION spi_prepared_plan_test_nested(a text) RETURNS text AS 'if "myplan" not in SD: @@ -57,7 +57,7 @@ except Exception as ex: plpy.error(str(ex)) return None ' - LANGUAGE plpythonu; + LANGUAGE plpython3u; CREATE FUNCTION join_sequences(s sequences) RETURNS text AS 'if not s["multipart"]: @@ -69,7 +69,7 @@ for r in rv: seq = seq + r["sequence"] return seq ' - LANGUAGE plpythonu; + LANGUAGE plpython3u; CREATE FUNCTION spi_recursive_sum(a int) RETURNS int AS 'r = 0 @@ -77,7 +77,7 @@ if a > 1: r = plpy.execute("SELECT spi_recursive_sum(%d) as a" % (a-1))[0]["a"] return a + r ' - LANGUAGE plpythonu; + LANGUAGE plpython3u; -- -- spi and nested calls -- @@ -155,7 +155,7 @@ if result.status() > 0: return result.nrows() else: return None -$$ LANGUAGE plpythonu; +$$ LANGUAGE plpython3u; SELECT result_metadata_test($$SELECT 1 AS foo, '11'::text AS bar UNION SELECT 2, '22'$$); INFO: True INFO: ['foo', 'bar'] @@ -177,7 +177,7 @@ CREATE FUNCTION result_nrows_test(cmd text) RETURNS int AS $$ result = plpy.execute(cmd) return result.nrows() -$$ LANGUAGE plpythonu; +$$ LANGUAGE plpython3u; SELECT result_nrows_test($$SELECT 1$$); result_nrows_test ------------------- @@ -206,7 +206,7 @@ CREATE FUNCTION result_len_test(cmd text) RETURNS int AS $$ result = plpy.execute(cmd) return len(result) -$$ LANGUAGE plpythonu; +$$ LANGUAGE plpython3u; SELECT result_len_test($$SELECT 1$$); result_len_test ----------------- @@ -246,7 +246,7 @@ result[-1] = {'c': 1000} result[:2] = [{'c': 10}, {'c': 100}] plpy.info([item['c'] for item in result[:]]) -# raises TypeError, but the message differs on Python 2.6, so silence it +# raises TypeError, catch so further tests could be added try: plpy.info(result['foo']) except TypeError: @@ -254,7 +254,7 @@ except TypeError: else: assert False, "TypeError not raised" -$$ LANGUAGE plpythonu; +$$ LANGUAGE plpython3u; SELECT result_subscript_test(); INFO: 2 INFO: 4 @@ -272,7 +272,7 @@ result = plpy.execute("select 1 where false") plpy.info(result[:]) -$$ LANGUAGE plpythonu; +$$ LANGUAGE plpython3u; SELECT result_empty_test(); INFO: [] result_empty_test @@ -285,7 +285,7 @@ AS $$ plan = plpy.prepare(cmd) result = plpy.execute(plan) return str(result) -$$ LANGUAGE plpythonu; +$$ LANGUAGE plpython3u; SELECT result_str_test($$SELECT 1 AS foo UNION SELECT 2$$); result_str_test ------------------------------------------------------------ @@ -306,12 +306,12 @@ for row in res: if row['lname'] == 'doe': does += 1 return does -$$ LANGUAGE plpythonu; +$$ LANGUAGE plpython3u; CREATE FUNCTION double_cursor_close() RETURNS int AS $$ res = plpy.cursor("select fname, lname from users") res.close() res.close() -$$ LANGUAGE plpythonu; +$$ LANGUAGE plpython3u; CREATE FUNCTION cursor_fetch() RETURNS int AS $$ res = plpy.cursor("select fname, lname from users") assert len(res.fetch(3)) == 3 @@ -329,7 +329,7 @@ except StopIteration: pass else: assert False, "StopIteration not raised" -$$ LANGUAGE plpythonu; +$$ LANGUAGE plpython3u; CREATE FUNCTION cursor_mix_next_and_fetch() RETURNS int AS $$ res = plpy.cursor("select fname, lname from users order by fname") assert len(res.fetch(2)) == 2 @@ -342,7 +342,7 @@ except AttributeError: assert item['fname'] == 'rick' assert len(res.fetch(2)) == 1 -$$ LANGUAGE plpythonu; +$$ LANGUAGE plpython3u; CREATE FUNCTION fetch_after_close() RETURNS int AS $$ res = plpy.cursor("select fname, lname from users") res.close() @@ -352,7 +352,7 @@ except ValueError: pass else: assert False, "ValueError not raised" -$$ LANGUAGE plpythonu; +$$ LANGUAGE plpython3u; CREATE FUNCTION next_after_close() RETURNS int AS $$ res = plpy.cursor("select fname, lname from users") res.close() @@ -365,7 +365,7 @@ except ValueError: pass else: assert False, "ValueError not raised" -$$ LANGUAGE plpythonu; +$$ LANGUAGE plpython3u; CREATE FUNCTION cursor_fetch_next_empty() RETURNS int AS $$ res = plpy.cursor("select fname, lname from users where false") assert len(res.fetch(1)) == 0 @@ -378,7 +378,7 @@ except StopIteration: pass else: assert False, "StopIteration not raised" -$$ LANGUAGE plpythonu; +$$ LANGUAGE plpython3u; CREATE FUNCTION cursor_plan() RETURNS SETOF text AS $$ plan = plpy.prepare( "select fname, lname from users where fname like $1 || '%' order by fname", @@ -387,12 +387,12 @@ for row in plpy.cursor(plan, ["w"]): yield row['fname'] for row in plan.cursor(["j"]): yield row['fname'] -$$ LANGUAGE plpythonu; +$$ LANGUAGE plpython3u; CREATE FUNCTION cursor_plan_wrong_args() RETURNS SETOF text AS $$ plan = plpy.prepare("select fname, lname from users where fname like $1 || '%'", ["text"]) c = plpy.cursor(plan, ["a", "b"]) -$$ LANGUAGE plpythonu; +$$ LANGUAGE plpython3u; CREATE TYPE test_composite_type AS ( a1 int, a2 varchar @@ -401,7 +401,7 @@ CREATE OR REPLACE FUNCTION plan_composite_args() RETURNS test_composite_type AS plan = plpy.prepare("select $1 as c1", ["test_composite_type"]) res = plpy.execute(plan, [{"a1": 3, "a2": "label"}]) return res[0]["c1"] -$$ LANGUAGE plpythonu; +$$ LANGUAGE plpython3u; SELECT simple_cursor_test(); simple_cursor_test -------------------- |