Query specific table using relative position in search path - Mailing list pgsql-sql

From George Woodring
Subject Query specific table using relative position in search path
Date
Msg-id CACi+J=QBi1Mdw6dBbSz9wrfTU7rA4VPS1br0oWGsM0mb7aWySw@mail.gmail.com
Whole thread Raw
Responses Re: Query specific table using relative position in search path
List pgsql-sql
Currently we have a database per customer approach to our database methodology.  In this we have the customer tables in the public schema.  We create restrictions by having views in different schemas and modifying the search path. (restriction, public).

We are investigating having a scheme of having multiple customers in the same database and each of them having their own schema ( restriction, custName ).

Is there a way to have a generic query to a custName table by referencing its position in the search_path?

Example
select * from mytable;  -- Gives restricted answers
select * from super.mytable -- Gives custName answers

Currently this is done by public.mytable,  but I am curious if there is a generic way without having to know the custName schema.

Thanks
Woody 
iGLASS Networks
www.iglass.net

pgsql-sql by date:

Previous
From: David Johnston
Date:
Subject: Re: json and aggregate
Next
From: Michael Schmidt
Date:
Subject: How to script inserts where id is needed as fk