![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
|
Here's a simplified version: CREATE TYPE test_type AS (x integer); CREATE FUNCTION test() RETURNS test_type AS $$ DECLARE rec record; BEGIN SELECT INTO rec 1; RETURN rec; END; $$ LANGUAGE plpgsql; SELECT test(); I get an assertion failure if rec is declared as a record but not if it's declared as a test_type. And only in 8.0.5, not in 8.1.1 or 8.2devel. |
#2
| |||
| |||
|
|
We need to fix plpgsql to ensure that what it returns is of the expected record type. |
#3
| |||
| |||
|
|
Michael Fuhr <mike (AT) fuhr (DOT) org> writes: I get an assertion failure if rec is declared as a record but not if it's declared as a test_type. And only in 8.0.5, not in 8.1.1 or 8.2devel. I find that the lack of an assertion failure in 8.1 is a happenstance of unrelated changes. The problem is that plpgsql is making no effort at all to ensure that the record type it returns is the same as it's declared to return. |
![]() |
| Thread Tools | |
| Display Modes | |
| |