The following bug has been logged on the website:
Bug reference: 13796
Logged by: Peter Plachta
Email address: pplachta@gmail.com
PostgreSQL version: 9.4.5
Operating system: mac os x
Description:
Here is a testcase:
create type complex as (a1 int, a2 numeric, a3 text, a4 int, a5 int);
create or replace function foo(arg complex) returns complex as $$
begin
return ( select arg );
end; $$ language plpgsql;
-- modify type test
alter type complex drop attribute a4;
select foo(row(1, 1.1, 'one', 111));
======================
The last one prints:
foo
--------------
(1,1.1,one,)
(1 row)
======================
Why is the last element NULLed out? It's not like I can pass 5 elements to
the function.