hai..
i need to get all tables names from my database.i am using postgresql.what is the query for selecting all table names..please help me

Hi, from the psql client you can use \dt, it will list something like this:

\dt
           List of relations
 Schema |   Name    | Type  |  Owner   
--------+-----------+-------+----------
 public | cities    | table | cereal
 public | provinces | table | cereal
 public | weather   | table | cereal
 (3 rows)

Otherwise use a query like this:

select table_name from information_schema.tables where table_schema = 'public' and table_type = 'BASE TABLE';

If you remove the WHERE condition then you get also the information_schema tables.

Docs:

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.