Re: [GENERAL] partitioning using dblink

2008-03-22 Thread Bruce Momjian
Added to TODO: o Add checks to prevent a CREATE RULE views on inherited tables http://archives.postgresql.org/pgsql-general/2008-02/msg01420.php --- Tom Lane wrote: Scara Maccai [EMAIL PROTECTED]

Re: [GENERAL] partitioning using dblink

2008-03-03 Thread Bruce Momjian
Tom Lane wrote: Scara Maccai [EMAIL PROTECTED] writes: I got that there should be no difference... plus, I don't get any errors, You should have. The system enforces (or tries to) that a view can't be part of an inheritance hierarchy, but you seem to have managed to find a sequence of

Re: [GENERAL] partitioning using dblink

2008-03-03 Thread Tom Lane
Bruce Momjian [EMAIL PROTECTED] writes: Tom Lane wrote: Scara Maccai [EMAIL PROTECTED] writes: I got that there should be no difference... plus, I don't get any errors, You should have. The system enforces (or tries to) that a view can't be part of an inheritance hierarchy, but you seem

Re: [GENERAL] partitioning using dblink

2008-03-03 Thread Bruce Momjian
Tom Lane wrote: Bruce Momjian [EMAIL PROTECTED] writes: Tom Lane wrote: Scara Maccai [EMAIL PROTECTED] writes: I got that there should be no difference... plus, I don't get any errors, You should have. The system enforces (or tries to) that a view can't be part of an inheritance

Re: [GENERAL] partitioning using dblink

2008-03-03 Thread Scara Maccai
You should have. The system enforces (or tries to) that a view can't be part of an inheritance hierarchy, but you seem to have managed to find a sequence of operations that avoids those checks. Turning a table into a view with a manual CREATE RULE operation has always been a kluge,

Re: [GENERAL] partitioning using dblink

2008-03-03 Thread Tom Lane
Scara Maccai [EMAIL PROTECTED] writes: Is there a specific reason why views can't be part of an inheritance tree? I mean: it's that we don't want it or it would be just difficult to implement? It would certainly require a lot of rethinking of assumptions, in the planner and elsewhere. I have

Re: [GENERAL] partitioning using dblink

2008-02-29 Thread Scara Maccai
I can't get views to participate in the hierarchy... create table outings1 as select * from outings_root limit 0; alter table outings1 inherit outings_root; SELECT * FROM dblink('host=myhost dbname=tacche port=5433 user=postgres password=postgres'::text, 'SELECT * from

Re: [GENERAL] partitioning using dblink

2008-02-29 Thread Marko Kreen
On 2/29/08, Scara Maccai [EMAIL PROTECTED] 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

Re: [GENERAL] partitioning using dblink

2008-02-29 Thread Marko Kreen
On 2/29/08, Scara Maccai [EMAIL PROTECTED] wrote: 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 Exactly, because inheritance/constraint exclusion wont work with views. 2)

Re: [GENERAL] partitioning using dblink

2008-02-29 Thread Scara Maccai
@postgresql.org Inviato: Venerdì 29 febbraio 2008, 10:46:09 Oggetto: Re: [GENERAL] partitioning using dblink On 2/29/08, Scara Maccai [EMAIL PROTECTED] 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

Re: [GENERAL] partitioning using dblink

2008-02-29 Thread Scara Maccai
Exactly, because inheritance/constraint exclusion wont work with views. Ok, so there should be something written in the docs about it... From: the information about a view in the PostgreSQL system catalogs is exactly the same as it is for a table. So for the parser, there is absolutely no

Re: [GENERAL] partitioning using dblink

2008-02-29 Thread Marko Kreen
On 2/29/08, Scara Maccai [EMAIL PROTECTED] wrote: Exactly, because inheritance/constraint exclusion wont work with views. Ok, so there should be something written in the docs about it... From: the information about a view in the PostgreSQL system catalogs is exactly the same as it

Re: [GENERAL] partitioning using dblink

2008-02-29 Thread Tom Lane
Scara Maccai [EMAIL PROTECTED] writes: I got that there should be no difference... plus, I don't get any errors, You should have. The system enforces (or tries to) that a view can't be part of an inheritance hierarchy, but you seem to have managed to find a sequence of operations that avoids

[GENERAL] partitioning using dblink

2008-02-28 Thread Scara Maccai
Hi, I started thinking that using dblink I could easily get some kind of read only multi-server partitioning, if only VIEWs could be declared with INHERITS... That way I think I could 1) add as many views as the number of DBs as CREATE VIEW mytable_part_n AS SELECT using dblink on remote

Re: [GENERAL] partitioning using dblink

2008-02-28 Thread Alvaro Herrera
Scara Maccai wrote: I started thinking that using dblink I could easily get some kind of read only multi-server partitioning, if only VIEWs could be declared with INHERITS... I think you can do pretty much the same thing with PL/Proxy; see

Re: [GENERAL] partitioning using dblink

2008-02-28 Thread Scara Maccai
Alvaro Herrera wrote: I think you can do pretty much the same thing with PL/Proxy; see https://developer.skype.com/SkypeGarage/DbProjects/PlProxy Mmmh, I actually looked into that but I thought it only worked with user functions... am I wrong? What I'd like to have is an almost-transparent