Skip site navigation (1) Skip section navigation (2)

Re: partitioning using dblink

From: "Marko Kreen" <markokr(at)gmail(dot)com>
To: "Scara Maccai" <m_lists(at)yahoo(dot)it>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: partitioning using dblink
Date: 2008-02-29 16:46:09
Message-ID: e51f66da0802290846v38a8f67fqc9610ae4ed40dcd4@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-general
On 2/29/08, Scara Maccai <m_lists(at)yahoo(dot)it> wrote:
> I can't get views to participate in the hierarchy...

The partition exclusion _may_ work if you do something like:

create view as
  select * from dblink/plproxy-from-part1 where part1 constraint
  union all
  select * from dblink/plproxy-from-part2 where part2 constraint

So if you do 'select * from view where constraint;' the postgres
will skip partitions which do not match.  You may need to
define the setof function immutable or something... i'm not sure.

But any contraint exclusion wont change the fact you are
doing select * from tbl; in remote db, which makes the
exercise quite pointess IMHO.

I obviously would recommend pl/proxy for such task, but that
would expect you are able to write your queries.  If you are
in situation where you don't control the queries, then plproxy
quite likely is not use.

-- 
marko

In response to

pgsql-general by date

Next:From: Alvaro HerreraDate: 2008-02-29 16:51:30
Subject: Re: errors in pg_restore on windows?
Previous:From: ClodoaldoDate: 2008-02-29 16:31:14
Subject: Re: Insert vs Update syntax

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group