Using wildcard for table name ?

From: Francisco Leovey <fleovey(at)yahoo(dot)com>
To: "pgsql-novice(at)postgresql(dot)org" <pgsql-novice(at)postgresql(dot)org>
Subject: Using wildcard for table name ?
Date: 2013-07-26 18:21:44
Message-ID: 1374862904.75803.YahooMailNeo@web164901.mail.bf1.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hello
 
I have a database in Postgres 9 with 75 tables, all have the exact same definition except for the name of the table.
Each one contains data for people who are doctors (table name = doctors), nurses (table name = nurses) etc. etc.
How can I do a select to find a given person's name (a single field) without mentioniing all 75 table names ? I do not need to know fron which table it came, just need to know if it exists.
 
Is there a "select * from * where *.name ='Joe Blow';" kind of syntax ?
 
I could join all tables into one to do the search but we want to keep data separated due to volume.
Thanks

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Daniel Staal 2013-07-26 18:29:34 Re: Using wildcard for table name ?
Previous Message Luca Ferrari 2013-07-26 16:05:28 Re: Fwd: Tricky join and update with same table