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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user