Package: postgresql-8.4
Version: 8.4.8-0squeeze1
Severity: grave

Hi there,

Unfortunately this "stable" upgrade of PostgreSQL 8.4.7-0squeeze2 to
8.4.8-0squeeze1 introduced a bug apparently from the 9.0 branch that is
now consistently breaking queries on our production "stable" machines.

Upstream it's registered as bug #6020 and confirmed:
http://archives.postgresql.org/pgsql-bugs/2011-05/msg00080.php
I've told them about it again and so far they've ignored me:
http://archives.postgresql.org/pgsql-bugs/2011-06/msg00122.php
I'm filing this in Debian because the severity of the problem for us
has now gone from "possible future upgrade delay" to "WTF" :<

Anyway, this kind of a query fails under PostgreSQL 9.0.4 and 8.4.8:

SELECT * FROM acl_get_list('news', 258, 0);
ERROR:  wrong record type supplied in RETURN NEXT
DETAIL:  Returned type bpchar does not match expected type character(4) in 
column 3.
CONTEXT:  PL/pgSQL function "acl_get_list" line 9 at RETURN NEXT

Where the code is:

CREATE TYPE acl_list AS (
  ugid integer,
  isuser boolean,
  acl_id CHAR(4)
[...]
);

CREATE OR REPLACE FUNCTION acl_get_list(CHAR(4), INTEGER, INTEGER) RETURNS 
SETOF acl_list AS '
DECLARE
    p_acl_id          ALIAS FOR $1;
    p_acl_object_id   ALIAS FOR $2;
    p_lev             ALIAS FOR $3;
    rec               RECORD;
    rec1              RECORD;
BEGIN
[...]
    FOR rec IN SELECT * FROM acl_inherits WHERE acl_id = p_acl_id AND object_id 
= p_acl_object_id LOOP
        FOR rec1 IN SELECT * FROM acl_get_list(rec.parent_acl_id, 
rec.parent_object_id, p_lev + 1) LOOP
            RETURN NEXT rec1;                                                   
                       
        END LOOP;
    END LOOP;
[...]

This worked just fine in 8.1, 8.3, earlier 8.4, and doesn't seem wrong.

Please revert this bad change ASAP...
TIA.

-- 
     2. That which causes joy or happiness.



-- 
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to