Re: Using wildcard for table name ?

Поиск
Список
Период
Сортировка
От Francisco Leovey
Тема Re: Using wildcard for table name ?
Дата
Msg-id 1374877594.1250.YahooMailNeo@web164903.mail.bf1.yahoo.com
обсуждение исходный текст
Ответ на Re: Using wildcard for table name ?  (David Johnston <polobo@yahoo.com>)
Ответы Re: Using wildcard for table name ?
Список pgsql-novice
Hi thank you for your response.
There are no duplicate names.
My question was solved by writing a Perl program that gets the table names as a list from the database structure and then simply searching each table.
Years ago I worked with Informix and there was a syntax for using a variable for the table name, such as.  (not exact syntax)
Select  * from (select table-name from database_info ) where name ='Joe Blow';

I guess I was looking for that, but in Perl I managed to do the same thing with a loop on the table names.





From: David Johnston <polobo@yahoo.com>
To: pgsql-novice@postgresql.org
Sent: Friday, July 26, 2013 3:57 PM
Subject: Re: [NOVICE] Using wildcard for table name ?

Francisco Leovey wrote
> I could join all tables into one to do the search but we want to keep data
> separated due to volume.

Pre-mature optimization is bad.

Partitioning is one solution while it has problems they are considerably
less-worse than what you are stuck with currently.

That said the answer to your specific question is NO.  Since you only
provided enough information to answer your specific question any advice that
may be offered is suspect since we know very little about your actual
situation.

I am curious how you deal with duplicate names and what you want returned in
that situation.  It may be worth having a master "name directory" table with
two columns.  The first column would be the person name and the second
column would be an array of table names in which that person name appears.
You would need triggers (or CRUD functions) to maintain consistency.  You
could then write a function that queries this table to find out which other
tables the name appears on and then you can create dynamic SQL queries for
just those tables.

David J.





--
View this message in context: http://postgresql.1045698.n5.nabble.com/Using-wildcard-for-table-name-tp5765314p5765317.html
Sent from the PostgreSQL - novice mailing list archive at Nabble.com.


--
Sent via pgsql-novice mailing list (pgsql-novice@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-novice

В списке pgsql-novice по дате отправления:

Предыдущее
От: David Johnston
Дата:
Сообщение: Re: Using wildcard for table name ?
Следующее
От: Some Developer
Дата:
Сообщение: Passing arguments to a function called by a trigger