Search Postgresql Archives

Re: How to obtain the list of data table name only

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

 



Here is the definition of a view I use to retrieve all of the tables and a 
list of columns for tables that appear in the "public" schema ... I have 
others that only retrieve a list of the table names and the views in the 
public schema as well...

-- View: "vcat_pgcolumns"

-- DROP VIEW vcat_pgcolumns;

CREATE OR REPLACE VIEW vcat_pgcolumns AS
 SELECT psut.relid AS tbloid, pa.attnum AS colid, psut.relname AS tblname, 
pa.attname AS colname
   FROM pg_stat_user_tables psut
   JOIN pg_attribute pa ON psut.relid = pa.attrelid
  WHERE psut.schemaname = 'public'::name AND pa.attstattarget = -1
  ORDER BY psut.relname, pa.attnum;

ALTER TABLE vcat_pgcolumns OWNER TO postgres;

"Sunny" <sunny076@xxxxxxxxx> wrote in message 
news:1121379847.886478.74380@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> Hi,
>
> I am wondering if anyone can tell me how I can obtain only the list of
> data table in postgresql without function and other ancillary tables. I
> hope that I can add a tag that can filter only data table.
>
> I am using the following SQL Statement:
>
> "SELECT TABLE_NAME, TABLE_TYPE FROM INFORMATION_SCHEMA.TABLES"
>
> I would appreciate if anyone can enligten me on how this can be
> achieve.
>
> Sunny
> 



---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
       subscribe-nomail command to majordomo@xxxxxxxxxxxxxx so that your
       message can get through to the mailing list cleanly

[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