From: Greg Fausak <greg@named.com>
To: pgsql-bugs@postgresql.org
Subject: BUG #6286: Table Partitioning - SQL/MED - interaction broken
Date: Thu, 3 Nov 2011 17:57:03 GMT
Message-ID: <201111031757.pA3Hv3KT052627@wwwmaster.postgresql.org> (raw)
The following bug has been logged online:
Bug reference: 6286
Logged by: Greg Fausak
Email address: greg@named.com
PostgreSQL version: 9.1.1
Operating system: Linux
Description: Table Partitioning - SQL/MED - interaction broken
Details:
I create a table partition:
table M
table A (check range) inherits M
table B (check range) inherits M
...
table X (check range) inherits M
ASSERT: a query with constraint exclusions=on, performed on M will select
the correct partitioned tables. Partitioning seems to work fine.
Second part, create a foreign table that is a file:
create server ES foreign data wrapper file_fdw;
create foreign table Y ( columns like table M ) server ES options (format
'csv', file '/tmp/x', ...);
ASSERT: a query against table Y (which has the same columns as table M)
shows data file the file /tmp/x. Perfect, SQL/MED works.
Here is the bug when trying to use the two together with a rule to bind
them:
create rule "_RETURN" as on select to X do instead select * from Y;
If I select * from X that works fine. But, when I do a select from the
partition table M, the EXPLAIN shows that table X is queried....but, the
rule for select is not being fired in this context, and no data is returned
from this partition.
In other words, how do I partition a table when partitions can be external
in the SQL/MED sense?
Thanks,
---greg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: greg@named.com
Subject: Re: BUG #6286: Table Partitioning - SQL/MED - interaction broken
In-Reply-To: <201111031757.pA3Hv3KT052627@wwwmaster.postgresql.org>
References: <201111031757.pA3Hv3KT052627@wwwmaster.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox