mirror of
https://git.postgresql.org/git/postgresql.git
synced 2026-02-07 15:47:34 +08:00
Fix two issues in plpython's handling of composite results.
Dropped columns within a composite type were not handled correctly. Also, we did not check for whether a composite result type had changed since we cached the information about it. Jan Urbański, per a bug report from Jean-Baptiste Quenot
This commit is contained in:
@ -308,6 +308,27 @@ SELECT * FROM test_inout_params('test_in');
|
||||
test_in_inout
|
||||
(1 row)
|
||||
|
||||
-- try changing the return types and call functions again
|
||||
ALTER TABLE table_record DROP COLUMN first;
|
||||
ALTER TABLE table_record DROP COLUMN second;
|
||||
ALTER TABLE table_record ADD COLUMN first text;
|
||||
ALTER TABLE table_record ADD COLUMN second int4;
|
||||
SELECT * FROM test_table_record_as('obj', 'one', 1, false);
|
||||
first | second
|
||||
-------+--------
|
||||
one | 1
|
||||
(1 row)
|
||||
|
||||
ALTER TYPE type_record DROP ATTRIBUTE first;
|
||||
ALTER TYPE type_record DROP ATTRIBUTE second;
|
||||
ALTER TYPE type_record ADD ATTRIBUTE first text;
|
||||
ALTER TYPE type_record ADD ATTRIBUTE second int4;
|
||||
SELECT * FROM test_type_record_as('obj', 'one', 1, false);
|
||||
first | second
|
||||
-------+--------
|
||||
one | 1
|
||||
(1 row)
|
||||
|
||||
-- errors cases
|
||||
CREATE FUNCTION test_type_record_error1() RETURNS type_record AS $$
|
||||
return { 'first': 'first' }
|
||||
|
||||
Reference in New Issue
Block a user