PostgreSQL command line help! How to run a SQL query?
Join Date: Jul 2007
Posts: 101
I am inside a PostgreSQL database through the command line interface. Now I want to run a query. Retrieve some info!
I have tried:
Code:
DATABASENAME=# SELECT columnname FROM tablename
But that does nothing. It seems like I need to press a play button or something. What more do I need to write to get it working?
Another similar thing I need help with is creating a user with restricted rights (preferably no writing rights).
I have tried:
Code:
DATABASENAME=# CREATE USER username
but that does nothing!
What is missing? What do I need to write for things to happen?
Join Date: Feb 2005
Posts: 13,154
I guess you need to finish each line with a semi-colon, unless you are doing so but just failed to list it with your examples.
Like this:
DATABASENAME=# SELECT columnname FROM tablename;
Join Date: Jul 2007
Posts: 101
Thanks dave. That did the trick!
Join Date: Jul 2007
Posts: 101
I have another small question I hope I can get help with. Sometimes the command prompt shows:
HOLDEMMANAGER2=#
Sometimes it shows:
HOLDEMMANAGER2(#
What does that mean?