Re: A query that doesn't work on 7.1 - Mailing list pgsql-sql

From Tom Lane
Subject Re: A query that doesn't work on 7.1
Date
Msg-id 3064.984098363@sss.pgh.pa.us
Whole thread Raw
In response to Re: A query that doesn't work on 7.1  (Kyle <kyle@actarg.com>)
List pgsql-sql
Kyle <kyle@actarg.com> writes:
>> You could probably gin up a usable avg(timestamp) using the avg(float8)
>> routines, since a timestamp is really just a double under the hood.

> When you say "gin up" are you talking about C, PL/XXX, or just casts?

I was thinking of full-scale cheating: make a new pg_aggregate entry for
avg(timestamp) that points at the existing pg_proc entries that support
avg(float8).  CREATE AGGREGATE won't do this for you, but there's always
good old INSERT INTO ...

> Here's a view of a union.  The two selects are fast when executed
> individually (and explain confirms that they use indexes).  When I
> query the view, though, it is slow (explain says the scans are
> sequential).

> Is this expected or a bug?

Seems odd.  Need enough info to reproduce, please?
        regards, tom lane


pgsql-sql by date:

Previous
From: Kyle
Date:
Subject: Re: A query that doesn't work on 7.1
Next
From: Ken Kline
Date:
Subject: perl dbd