Thread: PGAdmin4.11.1 on Ubuntu 18.04

PGAdmin4.11.1 on Ubuntu 18.04

From
Tony Shelver
Date:
I am getting an 'able oid' when querying any tables using the Query tool.
When using the view / edit data option, everything works fine.

I came across this
<<<

The problem is due to python3-psycopg2. The latest pgadmin4 version requires psycopg2-2.8. But if you're on Debian/Ubuntu stable, apt installed v2.7. So you need to update it with pip :

sudo pip3 install -U psycopg2
>>>
The problem is that the upgrade to psycopg 2.8 doesn't work, as it's installed as part of the dtsutils package along with pgadmin4.

Any ideas?

Re: PGAdmin4.11.1 on Ubuntu 18.04

From
Adrian Klaver
Date:
On 8/1/19 7:39 AM, Tony Shelver wrote:
> I am getting an 'able oid' when querying any tables using the Query tool.

Can you show the actual entire  error message?

More below.

> When using the view / edit data option, everything works fine.
> 
> I came across this
> <<<
> 
> The problem is due to python3-psycopg2. The latest pgadmin4 version 
> requires psycopg2-2.8. But if you're on Debian/Ubuntu stable, apt 
> installed v2.7. So you need to update it with pip :
> 
> |sudo pip3 install -U psycopg2
>>>>
> |
> 
> |The problem is that the upgrade to psycopg 2.8 doesn't work, as it's 
> installed as part of the dtsutils package along with pgadmin4.

I'm not following. If is installed as part of pgAdmin4 why do you need 
to upgrade?

> 
> |
> 
> |Any ideas?
> |
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com



Re: PGAdmin4.11.1 on Ubuntu 18.04

From
Adrian Klaver
Date:
On 8/1/19 7:39 AM, Tony Shelver wrote:
> I am getting an 'able oid' when querying any tables using the Query tool.
> When using the view / edit data option, everything works fine.

Should have asked in previous post:

What Postgres version(s)?

> 
> I came across this
> <<<
> 
> The problem is due to python3-psycopg2. The latest pgadmin4 version 
> requires psycopg2-2.8. But if you're on Debian/Ubuntu stable, apt 
> installed v2.7. So you need to update it with pip :
> 
> |sudo pip3 install -U psycopg2
>>>>
> |
> 
> |The problem is that the upgrade to psycopg 2.8 doesn't work, as it's 
> installed as part of the dtsutils package along with pgadmin4.
> 
> |
> 
> |Any ideas?
> |
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com



Re: PGAdmin4.11.1 on Ubuntu 18.04

From
Tony Shelver
Date:
Thanks for the replies: the version is PG11.4. 

As for needing to upgrade:  I just want to fix the problem.  This was a working environment until I updated pgAdmin4.

The fix suggested on Stackoverflow was to move to psycopg2 2.8, but it doesn't seem to be possible.

If there is another fix that anyone is aware of, I would love to know.

I tried to uninstall pgAdmin4, then install psycopg 2.8 via pip, then reinstall pgadmoin4 again using the Synatpic / Ubunto package manager, but it just installs pscopg2.7 over the top.

On Thu, 1 Aug 2019 at 16:50, Adrian Klaver <adrian.klaver@aklaver.com> wrote:
On 8/1/19 7:39 AM, Tony Shelver wrote:
> I am getting an 'able oid' when querying any tables using the Query tool.
> When using the view / edit data option, everything works fine.

Should have asked in previous post:

What Postgres version(s)?

>
> I came across this
> <<<
>
> The problem is due to python3-psycopg2. The latest pgadmin4 version
> requires psycopg2-2.8. But if you're on Debian/Ubuntu stable, apt
> installed v2.7. So you need to update it with pip :
>
> |sudo pip3 install -U psycopg2
>>>>
> |
>
> |The problem is that the upgrade to psycopg 2.8 doesn't work, as it's
> installed as part of the dtsutils package along with pgadmin4.
>
> |
>
> |Any ideas?
> |
>


--
Adrian Klaver
adrian.klaver@aklaver.com

Re: PGAdmin4.11.1 on Ubuntu 18.04

From
Tony Shelver
Date:
The article at stackoverflow is here

On Thu, 1 Aug 2019 at 17:28, Tony Shelver <tshelver@gmail.com> wrote:
Thanks for the replies: the version is PG11.4. 

As for needing to upgrade:  I just want to fix the problem.  This was a working environment until I updated pgAdmin4.

The fix suggested on Stackoverflow was to move to psycopg2 2.8, but it doesn't seem to be possible.

If there is another fix that anyone is aware of, I would love to know.

I tried to uninstall pgAdmin4, then install psycopg 2.8 via pip, then reinstall pgadmoin4 again using the Synatpic / Ubunto package manager, but it just installs pscopg2.7 over the top.

On Thu, 1 Aug 2019 at 16:50, Adrian Klaver <adrian.klaver@aklaver.com> wrote:
On 8/1/19 7:39 AM, Tony Shelver wrote:
> I am getting an 'able oid' when querying any tables using the Query tool.
> When using the view / edit data option, everything works fine.

Should have asked in previous post:

What Postgres version(s)?

>
> I came across this
> <<<
>
> The problem is due to python3-psycopg2. The latest pgadmin4 version
> requires psycopg2-2.8. But if you're on Debian/Ubuntu stable, apt
> installed v2.7. So you need to update it with pip :
>
> |sudo pip3 install -U psycopg2
>>>>
> |
>
> |The problem is that the upgrade to psycopg 2.8 doesn't work, as it's
> installed as part of the dtsutils package along with pgadmin4.
>
> |
>
> |Any ideas?
> |
>


--
Adrian Klaver
adrian.klaver@aklaver.com

Re: PGAdmin4.11.1 on Ubuntu 18.04

From
Ron
Date:
I think the real question is "how do I make pgadmin4 use the locally installed psycopg instead of the system version?"

On 8/1/19 10:32 AM, Tony Shelver wrote:
The article at stackoverflow is here

On Thu, 1 Aug 2019 at 17:28, Tony Shelver <tshelver@gmail.com> wrote:
Thanks for the replies: the version is PG11.4. 

As for needing to upgrade:  I just want to fix the problem.  This was a working environment until I updated pgAdmin4.

The fix suggested on Stackoverflow was to move to psycopg2 2.8, but it doesn't seem to be possible.

If there is another fix that anyone is aware of, I would love to know.

I tried to uninstall pgAdmin4, then install psycopg 2.8 via pip, then reinstall pgadmoin4 again using the Synatpic / Ubunto package manager, but it just installs pscopg2.7 over the top.

On Thu, 1 Aug 2019 at 16:50, Adrian Klaver <adrian.klaver@aklaver.com> wrote:
On 8/1/19 7:39 AM, Tony Shelver wrote:
> I am getting an 'able oid' when querying any tables using the Query tool.
> When using the view / edit data option, everything works fine.

Should have asked in previous post:

What Postgres version(s)?

>
> I came across this
> <<<
>
> The problem is due to python3-psycopg2. The latest pgadmin4 version
> requires psycopg2-2.8. But if you're on Debian/Ubuntu stable, apt
> installed v2.7. So you need to update it with pip :
>
> |sudo pip3 install -U psycopg2
>>>>
> |
>
> |The problem is that the upgrade to psycopg 2.8 doesn't work, as it's
> installed as part of the dtsutils package along with pgadmin4.
>
> |
>
> |Any ideas?
> |
>


--
Adrian Klaver
adrian.klaver@aklaver.com

--
Angular momentum makes the world go 'round.

Re: PGAdmin4.11.1 on Ubuntu 18.04

From
Adrian Klaver
Date:
On 8/1/19 8:34 AM, Ron wrote:
> I think the real question is "how do I make pgadmin4 use the locally 
> installed psycopg instead of the system version?"
> 

Yeah the requirements file shows psycopg2-2.8:
https://github.com/postgres/pgadmin4/blob/master/requirements.txt

The issue(I'm assuming) is:

http://initd.org/psycopg/articles/2019/04/04/psycopg-28-released/
"Added table_oid and table_column attributes on cursor.description items 
(ticket #661)."

Have you looked at:

~/.config/pgadmin/pgadmin4.conf

to see what it is using as PythonPath?


-- 
Adrian Klaver
adrian.klaver@aklaver.com



Re: PGAdmin4.11.1 on Ubuntu 18.04

From
Adrian Klaver
Date:
On 8/1/19 8:28 AM, Tony Shelver wrote:
> Thanks for the replies: the version is PG11.4.

> I tried to uninstall pgAdmin4, then install psycopg 2.8 via pip, then 
> reinstall pgadmoin4 again using the Synatpic / Ubunto package manager, 
> but it just installs pscopg2.7 over the top.
> 

What repo are you getting the packages from?

-- 
Adrian Klaver
adrian.klaver@aklaver.com



Re: PGAdmin4.11.1 on Ubuntu 18.04

From
Adrian Klaver
Date:
On 8/1/19 8:28 AM, Tony Shelver wrote:
> Thanks for the replies: the version is PG11.4.
> 

> I tried to uninstall pgAdmin4, then install psycopg 2.8 via pip, then 
> reinstall pgadmoin4 again using the Synatpic / Ubunto package manager, 
> but it just installs pscopg2.7 over the top.
> 

If you are installing from the PGDG repo's then it seems someone did not 
get the memo from the requirements.txt:

"# IMPORTANT:
#
#If runtime or build time dependencies are changed in this file, the # 
#committer*must* ensure the DEB and RPM package maintainers are informed 
#as soon as possible."

psycopg2>=2.8

apt-cache show pgadmin4-common
Package: pgadmin4-common
Source: pgadmin4
Version: 4.11-1.pgdg16.04+1

Depends: ...,  python3-psycopg2 (>= 2.7.4), ...

There is an issue filed:

https://redmine.postgresql.org/issues/4550

You will need a community account to see/update.
I will be updating issue.



-- 
Adrian Klaver
adrian.klaver@aklaver.com



Re: PGAdmin4.11.1 on Ubuntu 18.04

From
Ray O'Donnell
Date:
On 01/08/2019 16:32, Tony Shelver wrote:
> The article at stackoverflow is here 
> <https://stackoverflow.com/questions/57226520/select-does-not-return-values-postgres-11-4>

Thanks for the link! The solution given in one of the comments there 
worked for me (Debian 9):

- Install pip3 if needed: sudo apt install python3-pip

- pip3 install psycopg2-binary (doesn't need pg_config)

- Edit ~/.config/pgadmin/pgadmin4.conf and set 
PythonPath="/home/rod/.local/python3.5;/home/rod/.local/python3.5/site-packages"

I then needed to kill the pgAdmin4 server so that it picked up the new 
setting.

Ray.

-- 
Raymond O'Donnell // Galway // Ireland
ray@rodonnell.ie



Re: PGAdmin4.11.1 on Ubuntu 18.04

From
Daniele Varrazzo
Date:
On Thu, Aug 1, 2019 at 4:43 PM Adrian Klaver <adrian.klaver@aklaver.com> wrote:

> Yeah the requirements file shows psycopg2-2.8:
> https://github.com/postgres/pgadmin4/blob/master/requirements.txt
>
> The issue(I'm assuming) is:
>
> http://initd.org/psycopg/articles/2019/04/04/psycopg-28-released/
> "Added table_oid and table_column attributes on cursor.description items
> (ticket #661)."

Couldn't be pgadmin forgiving if these attributes are not available?

-- Daniele



Re: PGAdmin4.11.1 on Ubuntu 18.04

From
Adrian Klaver
Date:
On 8/1/19 9:05 AM, Daniele Varrazzo wrote:
> On Thu, Aug 1, 2019 at 4:43 PM Adrian Klaver <adrian.klaver@aklaver.com> wrote:
> 
>> Yeah the requirements file shows psycopg2-2.8:
>> https://github.com/postgres/pgadmin4/blob/master/requirements.txt
>>
>> The issue(I'm assuming) is:
>>
>> http://initd.org/psycopg/articles/2019/04/04/psycopg-28-released/
>> "Added table_oid and table_column attributes on cursor.description items
>> (ticket #661)."
> 
> Couldn't be pgadmin forgiving if these attributes are not available?

Looks like it is wrapped up in this:

https://www.pgadmin.org/docs/pgadmin4/4.11/release_notes_4_11.html
Issue #1760 - Add support for editing of resultsets in the Query Tool, 
if the data can be identified as updatable.

https://redmine.postgresql.org/issues/1760

def check_updatable_results_pkeys(self):

    """

         This function is used to check whether the last successful query
    produced updatable results and sets the necessary flags and
         attributes accordingly. Should be called after polling for the 
results is successful(results are ready)

         """


...

   self.is_updatable_resultset, self.primary_keys, pk_names,table_oid = \
             is_query_resultset_updatable(conn, sql_path)


> 
> -- Daniele
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com



Re: PGAdmin4.11.1 on Ubuntu 18.04

From
Tony Shelver
Date:

>> What repo are you getting the packages from?

Repo looks like PostgreSQL apt repository https://apt.postgresql.org.  .../bionic-pgdg.main
--
Adrian Klaver
adrian.klaver@aklaver.com