10

Running any sort of query on pgAdmin 4 just returns a 'table_oid' under messages.

I am able to get the necessary data when running the query from the command line, for example

SELECT ST_MakePolygon(ST_GeomFromText('LINESTRING(75.15 29.53,77 29,77.6 29.5, 75.15 29.53)'));

I understand that table_oid refers to the object id of the table, but I have no idea how to access it.

Pardon me please if it is a simple question, but I am unable to find any resources online

Expected:

010300000001000000040000009A99999999C9524048E17A14AE873D4000000000004053400000000000003D4066666666666653400000000000803D409A99999999C9524048E17A14AE873D40

Actual:

table_oid

Philip Wee
  • 113
  • 7
  • 1
    I think it's a bug in pgAdmin 4. Last night I have updated pgAdminand have the same issue. I have already report this bug in pgAdmin's official forum. https://redmine.postgresql.org/issues/4527 – Mamun Jul 28 '19 at 13:44
  • 1
    By the way have you updated pgAdmin 4, or it happened without updating recently? – Mamun Jul 28 '19 at 13:45
  • 1
    This is not an issue with pgAdmin4 but with the Debian/Ubuntu packaging, Debian/Ubuntu repo has older version of psycopg2 library. – Murtuza Z Jul 30 '19 at 09:37
  • @MurtuzaZ I see, thank you, I will try updating my psycopg2 library. – Philip Wee Jul 31 '19 at 02:22
  • @Mamun It was the latest version of pgAdmin 4, freshly installed. For now I am working around it by using pgAdmin4 on windows, or pgAdmin3 on ubuntu – Philip Wee Jul 31 '19 at 02:23
  • It seems that my report has been repeated. This issue has already been posted before me. Here is the link of the original post, which has been accepted: https://redmine.postgresql.org/issues/4520 I think that @MurtuzaZ made the issue clear. I am using Ubuntu and didn't update the repo. I hope after updating the repo, the issue will be solved. Right now I am usuing pgAdmin 3 in Ubuntu and pgAdmin 4 in Mac which has 4.6. – Mamun Aug 01 '19 at 15:48

2 Answers2

9

From pgAdmin 4 project tracker: Temporary solution until next release and tested in my ubuntu 18.04 machine:

Replace these two 2 files:

/usr/share/pgadmin4/web/pgadmin/tools/sqleditor/__init_*_py /usr/share/pgadmin4/web/pgadmin/tools/sqleditor/command.py

Link to files:

Note: The first file's name is __init_*_py, without the *.

jhuamanchumo
  • 385
  • 2
  • 7
  • 21
  • not work for me on ubuntu 18.04 % ls -l /usr/share/pgadmin4/web/pgadmin/tools/sqleditor/ -rw-r--r-- 1 root root 30806 Aug 9 13:09 command.py -rw-r--r-- 1 root root 30390 Aug 9 13:13 command.py.0 -rw-r--r-- 1 root root 51183 Aug 9 13:10 __init__.py -rw-r--r-- 1 root root 50897 Aug 9 13:14 __init__.py.0 – hhzhu Aug 09 '19 at 20:50
  • Did work for me on Ubuntu 18.04, but I had to shutdown the pgAdmin server before it worked. – Paul Aug 13 '19 at 09:05
  • Worked also on Ubuntu 16.04. What an obscure way to fix this, thanks a lot! – Ivan Bilan Aug 19 '19 at 10:14
0

Try Squirrel SQL - Universal SQL Client. It's an extremely useful SQL client. I use it to access SQL Server, PostgreSQL, MySQL, Access. It's not as good looking as pgAdmin4.

  1. Install JAVA first, if not already installed.
  2. Install Squirrel SQL.
  3. Download the latest PostgreSQL JDBC driver, e.g. postgresql-42.2.6.jar, and put it into a convenient location.
  4. Open/Start Squirrel.
  5. Click the Drivers Tab and scroll down to PostgreSQL. Double click PostgreSQL. A "Change Driver: PostgreSQL" dialog box/window will open.
  6. Click the Extra Class Path tab and click the Add button. Navigate to and choose the PostgreSQL JDBC Driver that was downloaded in step 3. above.
    1. Click the List Drivers button, "org.postgresql.Driver" should appear in the Class Name drop down box.
    2. Click OK.

Setup PostgreSQL JDBC Driver

The driver should now be setup. Click the Aliases tab to setup a connection to your database. See my example screenshots.

Setup Database Connection