Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2004
    Location
    Amiens (FRANCE)
    Posts
    15

    Question Unanswered: how to get the tables list from a base with SQL ?

    hello,

    i would to know, in PHP, while i'm conencting to a postgreSQL database, i can get a list of the table which are in ?

    is there a global syntax SQL ?

    also, i know in MySQL, it is with :

    SHOW TABLE STATUS FROM mydbase


    how do with postgre ?
    Ps : i'm sorry for my english language expression mistake, cause i 'm french

  2. #2
    Join Date
    Sep 2001
    Location
    Vienna
    Posts
    400

    psql

    The best thing is turn on sql logging
    enter psql and type in the commands and look what sql is generated so you have
    every command in sql if you need it
    http://www.postgresql.org
    --Postgresql is the only kind of thing--

  3. #3
    Join Date
    Apr 2004
    Location
    Amiens (FRANCE)
    Posts
    15

    Thumbs up lol

    no, the best thing is to do a query like this :

    select relname from pg_stat_user_tables order by relname


    it is what i needed :-)

    now, in PHP, i can know what are the tables in the database where i'm connected

    sir perfect sir !
    Ps : i'm sorry for my english language expression mistake, cause i 'm french

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •