PgAdmin4 unable to query or view data

空扰寡人 提交于 2019-12-03 08:37:37

问题


I have a very basic PostgreSql table. Despite the simple table schema, I cannot query it via PgAdmin4.

The View Data option is unresponsive; Query Tool option becomes unresponsive after a few attempts in opening and closing the panel. When the Query Tool is eventually (somehow) launched, a trivial SQL statement like

SELECT * FROM test_table

will spin forever and never display.

The diagram above shows the exact same table, which is okay under PgAdmin3.

The table was created empty. Then added with a row. But it threw errors about not having a Primary Key. Which also threw errors when I tried to set a Primary Key. So I used TeamPostgreSql to set a Primary Key. So all is good under PgAdmin3 now. Hence I'm really curious about what's going on with PgAdmin4?


回答1:


I'm running pgAdmin4 v3.0 and I've put localhost as host name.

I mean, left panel > servers > create > server and then connection tab > host name

I could not query tables, clicking on view/edit data > all rows had no results (nor error log entries).

After I changed server name from localhost to 127.0.0.1, all worked as expected!

I hope it helps, because I've lost so much time on this and could not find a proper answer.




回答2:


I find a way to view query result on Data Output window using the "Reset Layout" command from File menu. Save your current work (query) before as it will kind of restart pgAdmin4. Tested with pgAdmin 2.1




回答3:


1) First delete the log file to get rid of older logs

2) Start pgAdmin4.

3) Try to view data again

Can you check log file for any errors & paste it here?

Linux log location: ~/.pgadmin/pgadmin4.log

Windows log location: C:\Users\YOUR_USERNAME\AppData\Roaming\pgAdmin\pgadmin4.log




回答4:


Try naming your columns with lower case letters.

Or try with a blank query and write the SQL commands manually:

SELECT * FROM “test_table”
ORDER BY “Apple” ASC

I think this is a bug. The command the pgAdmin 4 is sending, does not contain the double quotes in the order command on the column name, and if you have upper case letters, SQL is going to convert them to lower case letters, thus not finding the sorting criteria.




回答5:


I fixed this by opening the connection, changing just the connection name and saving the connection.

Based on other comments, I'd say there is likely some difference in the persisted format of the connection and they need to be resaved by the new version to work.




回答6:


Warning: You may need to recreate connections.

This worked for me.

1.) Shutdown pgadmin4 3.1

2.) Delete folder: C:\Users\YOUR_USERNAME\AppData\Roaming\pgAdmin




回答7:


This problem I experienced with the internet explorer browser where the query tool was not loading at all. It just kept on spinning with a circle. I solved this issue by using chrome browser.

When you launch pgadmin4 it launches in internet explorer by deafult. it has a key attached to it like

http://127.0.0.1:57756/?key=0371aabd-b4c7-4454-8234-b1234416d7e5e.

you can just paste the above url in the browser directly and the pgadmin4 will open and query tool works in it. Or you cna use cmd and paste the belwo command and pgadmin4 will open as a standlone application rather tahn another tab in the browser and you cna use it like old pgadmin3.

C:\windows\system32>"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --app=http://127.0.0.1:57756/?key=0371aabd-b4c7-4454-8234-b1234416d7e5e




回答8:


I solved this in pgadmin 3 by go back to default view. However, I am not sure when I changed it t something else. Hope it helps.



来源:https://stackoverflow.com/questions/42466916/pgadmin4-unable-to-query-or-view-data

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!