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 <spam_eater@gmx.net>)
Ответы Re: dynamic table names  (David Johnston <polobo@yahoo.com>)
Список pgsql-general
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

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

Предыдущее
От: David Kerr
Дата:
Сообщение: Re: About postgres scale out
Следующее
От: David Johnston
Дата:
Сообщение: Re: dynamic table names