Re: Schema boggle... - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Schema boggle...
Date
Msg-id 13385.1068068041@sss.pgh.pa.us
Whole thread Raw
In response to Schema boggle...  (Chris Bowlby <excalibur@hub.org>)
Responses Re: Schema boggle...  ("Marc G. Fournier" <scrappy@postgresql.org>)
List pgsql-hackers
Chris Bowlby <excalibur@hub.org> writes:
>  As you can see this is a nice, clean way to break down some datasets.
> But, if I do:

>  set search_path to public, test_001, test_002;

>  I only get access to the tables in test_001 and public, the tables in
> test_002 are not listed, and thus I do not see them on the screen while
> doing a "\d".

Well, sure.  They are masked by the identically named tables in
test_001.  How else would you expect it to work?

> 2. Issue 2, is more a SQL issue then anything, but I'd like to be able
> to do something to the affect of:

>  SELECT * FROM test_*.test_domains ORDER BY domain_name;

I can't see trying to support this at the SQL level.  You might consider
making a plpgsql function that constructs a UNION ALL query listing all
the proper schemas and then EXECUTEs it on-the-fly.

Another possible solution is to make all the individual tables be
inheritance children of a master table.  Then selecting from the master
would work (and would be equivalent to the UNION performance-wise, I
think).
        regards, tom lane


pgsql-hackers by date:

Previous
From: Manfred Spraul
Date:
Subject: Re: Performance features the 4th
Next
From: Tom Lane
Date:
Subject: Re: \xDD patch for 7.5devel