Search Postgresql Archives

Re: dynamic table names

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux