Received: from kahuna.versions.com (kahuna.versions.com [204.17.38.231]) by postgresql.org (8.11.3/8.11.1) with SMTP id f5BEcqE16262 for ; Mon, 11 Jun 2001 10:38:52 -0400 (EDT) (envelope-from pierre@kahuna.versions.com) Received: (qmail 31515 invoked by uid 502); 11 Jun 2001 14:38:47 -0000 Message-ID: <20010611143846.31514.qmail@kahuna.versions.com> From: pierre@kahuna.versions.com Date: 11 Jun 2001 07:38:46 -0700 Subject: Table design issue.... To: pgsql-sql@postgresql.org Date: Mon, 11 Jun 101 07:38:46 -0700 (MST) Content-Type: text X-Archive-Number: 200106/156 X-Sequence-Number: 3377 Hi all, I've got a situation where I need to be able to query for the same sort of data across multiple tables. Let me give some example tables then explain. create table t1 ( t_attr1 text[], t_attr2 text[] ); create table a1 ( a_attr1 text[], a_attr2 text[] ); create table c1 ( c_attr1 text[], c_attr2 text[], c_attr3 text[] ); In each of the above tables *_attr*[1] contains a flag that determines what type of attribute it is. t1.t_attr1[1] == a1.a_attr2[1] == c1_.c_attr3[1] == FLAG In otherwords, the attribute with the specific flag in quesiton is not known at runtime, unless I keep a table with the column names and table names setup. Also, new *1 tables could be created dynamically with new attr*'s, and the number of columns within the tables isn't going to be the same. What I need to be able to do is say something like: "For ALL *1 tables with *_attr*[1] == FLAG return rows with VALUE" Ideas? Comments? Suggestions? Am I being crazy? Pierre