Run PostgreSQL queries from the command line

前端 未结 7 1876
逝去的感伤
逝去的感伤 2020-12-12 09:40

I inserted a data into a table....I wanna see now whole table with rows and columns and data. How I can display it through command?

7条回答
  •  半阙折子戏
    2020-12-12 10:22

    If your DB is password protected, then the solution would be:

    PGPASSWORD=password  psql -U username -d dbname -c "select * from my_table"
    

提交回复
热议问题