Re: partitioning using dblink - Mailing list pgsql-general

From Scara Maccai
Subject Re: partitioning using dblink
Date
Msg-id 351565.6593.qm@web28103.mail.ukl.yahoo.com
Whole thread Raw
In response to partitioning using dblink  (Scara Maccai <m_lists@yahoo.it>)
Responses Re: partitioning using dblink
List pgsql-general
I'm sorry, I didn't understand you post...

1) Why does my current implementation is not working? Hierarchy doesn't work with views in general, not only with
dblink
2) Why am I supposed to use unions in the view?
3) I know that I am doing select * from tbl in the remote db; that is something I can work on later.
At least I would like to see it working, since there is nothing in the docs that says it shouldn't be working...
4) I am not able to rewrite my queries.

----- Messaggio originale -----
Da: Marko Kreen <markokr@gmail.com>
A: Scara Maccai <m_lists@yahoo.it>
Cc: pgsql-general@postgresql.org
Inviato: Venerdì 29 febbraio 2008, 10:46:09
Oggetto: Re: [GENERAL] partitioning using dblink

On 2/29/08, Scara Maccai <m_lists@yahoo.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





      ___________________________________
L'email della prossima generazione? Puoi averla con la nuova Yahoo! Mail:
http://it.docs.yahoo.com/nowyoucan.html

pgsql-general by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: errors in pg_restore on windows?
Next
From: Tom Lane
Date:
Subject: Re: errors in pg_restore on windows?