Access Table Data from PSQL in PostgreSQL

In order to access data in a PostgreSQL table to view values stored, follow these detailed instructions.

  1. Open a command prompt to your server. I used Putty.
  2. switch to a database user with appropriate privileges. I switched to postgres user with: su postgres and enter your pass. mine starts with a “g”(hint for me:-))
  3. enter psql with: psql databasename
  4. at the psql command prompt enter: SELECT * FROM tablename;

That will show you all the data in the table on the command line.

Leave a Reply

Your email address will not be published. Required fields are marked *