Re: Is it a bug? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Is it a bug?
Date
Msg-id 4560.950919291@sss.pgh.pa.us
Whole thread Raw
In response to Is it a bug?  ("Mauricio da Silva Barrios" <typedeath@zipmail.com.br>)
List pgsql-hackers
"Mauricio  da Silva Barrios" <typedeath@zipmail.com.br> writes:
> mydb=> CREATE VIEW connection_last AS
>    SELECT * FROM connection as con_out
>     WHERE connection_start IN ( SELECT max(connection_start) FROM 
> connection as con_in
>                                 WHERE con_in.connection_owner = 
> con_out.connection_owner
>                                 GROUP BY connection_owner);
> mydb=> select * from connection_last;
> pqReadData() -- backend closed the channel unexpectedly.

Hmm.  Seems to work fine in current sources:

regression=#  select * from connection_last;connection_id | connection_owner |    connection_start    | connection_end
---------------+------------------+------------------------+----------------            3 |                2 |
2001-01-2200:00:00-05 | 00:02:02
 
(1 row)

I seem to recall that the rule rewriter had some problems dealing with
aggregate functions inside sub-selects in 6.5.*, and that's probably
what's causing your problem.

7.0 is scheduled to go beta next week, so I'd suggest picking up
a beta copy ...
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [HACKERS] queries on 2+ indices
Next
From: Tom Lane
Date:
Subject: Re: [HACKERS] Re: SQL compliance - why -- comments only at psql level ?