Re: strange thing with partitioning / rules / plpgsql - Mailing list pgsql-general

From Alvaro Herrera
Subject Re: strange thing with partitioning / rules / plpgsql
Date
Msg-id 20070129155747.GK14134@alvh.no-ip.org
Whole thread Raw
In response to strange thing with partitioning / rules / plpgsql  (Tomas Vondra <tv@fuzzy.cz>)
List pgsql-general
Tomas Vondra wrote:

> So far everything seems ok, but let's create another child table
>
[...]
> ======================================================================
>
> and do the execution plan again:
>
> ======================================================================
>
> EXPLAIN EXECUTE tmp;
>
> ------------------------------------------------------------------------
>  Aggregate  (cost=73.50..73.51 rows=1 width=4)
>    ->  Append  (cost=0.00..62.80 rows=4280 width=4)
>     ->  Seq Scan on parent  (cost=0.00..31.40 rows=2140 width=4)
>     ->  Seq Scan on child_0 parent  (cost=0.00..31.40 rows=2140 width=4)
>
> ======================================================================
>
> Ooops, the new child table is missing ;(

Yes, this is a known defect of the partitioning code, and it's one of
(probably the most powerful) reason why it's not enabled by default.

With PL/pgSQL functions you don't have to destroy and recreate the
function -- just close the connection and reconnect.

It's not fixed in 8.2.  There's been a lot of noise about fixing this
for 8.3 (look for "plan invalidation"), but it's not done yet.

--
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Limit on number of users in postgresql?
Next
From: Bruno Wolff III
Date:
Subject: Re: Load balancing across disks