Re: dynamic table names
От
John Smith
Тема
Re: dynamic table names
Дата
Msg-id
CAMZ8qd_0G54+4BFM4SZmCFnapGUW4ePaScCc9upPVQ+=OAYeGA@mail.gmail.com
Ответ на
Re: dynamic table names (Thomas Kellerer)
Список
Дерево обсуждения
dynamic table names John Smith <jayzee.smith@gmail.com>
Re: dynamic table names David Johnston <polobo@yahoo.com>
Re: dynamic table names Alban Hertroys <haramrae@gmail.com>
Re: dynamic table names Rob Sargent <robjsargent@gmail.com>
Re: dynamic table names Rob Sargent <robjsargent@gmail.com>
Re: dynamic table names Merlin Moncure <mmoncure@gmail.com>
Re: dynamic table names Thomas Kellerer <spam_eater@gmx.net>
Re: dynamic table names John Smith <jayzee.smith@gmail.com>
Re: dynamic table names David Johnston <polobo@yahoo.com>
david, you're right. i didn't realize it had to be executed inside a function so now i'm trying this:
-- create function
create or replace function get_tables(sname varchar) returns record as $$
select tablename from pg_tables where schemaname = $1;
$$ language 'plpgsql';
-- query tables where column 'fname' = 'john'
select * from get_tables('myschema') where fname = 'john';
any help? wishing for a "select * from *..." :)
thanks, jzs
-- create function
create or replace function get_tables(sname varchar) returns record as $$
select tablename from pg_tables where schemaname = $1;
$$ language 'plpgsql';
-- query tables where column 'fname' = 'john'
select * from get_tables('myschema') where fname = 'john';
any help? wishing for a "select * from *..." :)
thanks, jzs
В списке pgsql-general по дате отправления