different results from plpgsql functions related to last changes in master

Started by Pavel Stehuleabout 8 years ago3 messageshackers
Jump to latest
#1Pavel Stehule
pavel.stehule@gmail.com

Hi

I did update of plpgsql_check and I see, so some functions returns
different result than on older posgresql. Probably this is wanted behave,
but It should be mentioned as partial compatibility break, because some
regress test can be broken too.

create table t(i int);
create function test_t(OUT t) returns t AS $$
begin
$1 := null;
end;
$$ language plpgsql;

select test_t();

result on PostgreSQL11 is null, on older is empty record "()"

Regards

Pavel

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Pavel Stehule (#1)
Re: different results from plpgsql functions related to last changes in master

Pavel Stehule <pavel.stehule@gmail.com> writes:

I did update of plpgsql_check and I see, so some functions returns
different result than on older posgresql. Probably this is wanted behave,
but It should be mentioned as partial compatibility break, because some
regress test can be broken too.

This is mentioned in the relevant commit message (4b93f5799):

... A lesser, but still real, annoyance is that ROW format cannot
represent a true NULL composite value, only a row of per-field NULL
values, which is not exactly the same thing.

In the case you're showing here, a true NULL got changed into ROW(NULL)
by the old code, but that no longer happens.

regards, tom lane

#3Pavel Stehule
pavel.stehule@gmail.com
In reply to: Tom Lane (#2)
Re: different results from plpgsql functions related to last changes in master

2018-02-18 17:48 GMT+01:00 Tom Lane <tgl@sss.pgh.pa.us>:

Pavel Stehule <pavel.stehule@gmail.com> writes:

I did update of plpgsql_check and I see, so some functions returns
different result than on older posgresql. Probably this is wanted behave,
but It should be mentioned as partial compatibility break, because some
regress test can be broken too.

This is mentioned in the relevant commit message (4b93f5799):

... A lesser, but still real, annoyance is that ROW format cannot
represent a true NULL composite value, only a row of per-field NULL
values, which is not exactly the same thing.

In the case you're showing here, a true NULL got changed into ROW(NULL)
by the old code, but that no longer happens.

I understand, and I have not any problem with this behave. Just I am
expecting so lot of people will be surprised.

Regards

Pavel

Show quoted text

regards, tom lane