When I query my database using a role in pgAdmin on a remote client, I get the results of the query. However if I run the same query directly on the db server with the same role , I don't see the query output. I see the table are present with the "\dt" command but I am not able to view the results of the queries on these tables. Is there some configuration that is needed to enable querying the db from the same host ?

Note: Made edits to the question based on the comments.

  • You are probably connecting to a different server from within pgAdmin. Or you are using a different (Postgres) user Jul 1 '19 at 5:27
  • Can you specify "I cannot query the tables"? Jul 1 '19 at 5:57
  • Question needs to be a lot more specific to be useful. Jul 1 '19 at 6:14
  • @a_horse_with_no_name: No the server and user are the same.Anyway, I found the solution to my problem Jul 1 '19 at 8:09

Found the resolution to my issue. To check query results you need to terminate every query in psql with a semicolon ;. If the semicolon is not used you don't see the query result when using the psql command line.

Quote from the manual

Entering SQL Commands
At the prompt, the user can type in SQL commands. Ordinarily, input lines are sent to the server when a command-terminating semicolon is reached. An end of line does not terminate a command. Thus commands can be spread over several lines for clarity.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.