#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2002
    Location
    California
    Posts
    158
    Rep Power
    13

    A few simple commands


    I'm trying to migrate from MySQL to PostgreSQL but need to get a few functions down. I used the command 'SHOW TABLES' to show me all the tables in MySQL that are in the database but how do I do that with PostegreSQL?

    Secondly to view databases of course all you have to do in MySQL is 'SHOW DATABASES' but in PostgreSQL I have found that I need to type 'psql -U my_user -l' from the command line? Is there a way to do it with a query?

    Thanks,
    Richard S.
  2. #2
  3. Me likey breadsticks...
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Jan 2003
    Location
    Los Angeles
    Posts
    1,189
    Rep Power
    18
    From the psql prompt to list all tables do \dt .

    To list databases do \l .

    Also do a \? for more commands from psql.
    HTH
    -b
    PostgreSQL, it's what's for dinner...

IMN logo majestic logo threadwatch logo seochat tools logo