Skip site navigation (1) Skip section navigation (2)

add to table which name is in table

From: teknet(at)poczta(dot)onet(dot)pl
To: pgsql-admin(at)postgresql(dot)org
Subject: add to table which name is in table
Date: 2004-07-17 07:41:58
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-admin

i have table:

create table table_names (
id                      SERIAL,
name                VARCHAR(75) NOT NULL


and for each name in table_names i have table (which name is name field from

So in table_names i have records:

1 table1

2 table2

3 table3


So i have three other tables named: table1 table2 table3.

And i want to operate on that tables by reading their names from
table_names. I tried:

select * from (select name from table_names where id=1) as something;

but i received only:

(1 row)

And i wanted to receive everything from table1.

How can i do it ?





pgsql-admin by date

Next:From: Oliver ElphickDate: 2004-07-17 08:39:41
Subject: Re: add to table which name is in table
Previous:From: mike gDate: 2004-07-17 04:38:52
Subject: Re: inheritance question

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group