1
0
mirror of https://github.com/postgres/postgres.git synced 2025-12-12 02:37:31 +03:00

PL/Python: Convert oid to long/int

oid is a numeric type, so transform it to the appropriate Python
numeric type like the other ones.
This commit is contained in:
Peter Eisentraut
2012-09-29 12:41:00 -04:00
parent 811ca1300b
commit db0af74af2
5 changed files with 77 additions and 1 deletions

View File

@@ -119,6 +119,16 @@ SELECT * FROM test_type_conversion_float8(5000000000.5);
SELECT * FROM test_type_conversion_float8(null);
CREATE FUNCTION test_type_conversion_oid(x oid) RETURNS oid AS $$
plpy.info(x, type(x))
return x
$$ LANGUAGE plpythonu;
SELECT * FROM test_type_conversion_oid(100);
SELECT * FROM test_type_conversion_oid(2147483649);
SELECT * FROM test_type_conversion_oid(null);
CREATE FUNCTION test_type_conversion_text(x text) RETURNS text AS $$
plpy.info(x, type(x))
return x