Menu

#471 Issue with viewing Sequences

3.5.5
open
nobody
None
5
2019-11-08
2019-10-02
Mark Lane
No

I'm using phpPgAdmin 7.x-dev (PHP 7.3.10)

When i go to view a sequence i see ERROR: relation "pg_catalog.pg_sequence" does not exist
LINE 9: "city_id_seq" AS s, pg_catalog.pg_sequence m

I feel like this worked before. I am trying to find the last value of a city_id_seq value under a location schema.

PostgreSQL 9.2.24

Discussion

  • Mark Lane

    Mark Lane - 2019-10-02

    I should note we can still view them via command line. It's within phppgadmin that we aren't able to see the sequences anymore.

     
  • Mark Lane

    Mark Lane - 2019-10-03

    We also insteadll version 5.6 as we were using a 7.x-dev version http://phppgadmin.sourceforge.net/doku.php?id=download However we get the same error. Anyone have any similar experiences?

     
  • Robert B Curtis

    Robert B Curtis - 2019-11-07

    I'm having the same issue.

    PostgreSQL 8.4.20
    phpPgAdmin 5.6 (PHP 7.3.6)

    Works fine in phpPgAdmin 5.1 (PHP 7.2.7)

     
  • Robert B Curtis

    Robert B Curtis - 2019-11-07

    I have not fully tested it, but I appear to have been able to fix my local copy by modifying the following file:

    /usr/local/cpanel/base/3rdparty/phpPgAdmin/classes/database/Postgres.php

    In the getSequence() function I modified this $sql variable:

        $sql = "
            SELECT
                c.relname AS seqname, s.*, 
                m.seqstart AS start_value, m.seqincrement AS increment_by, m.seqmax AS max_value, m.seqmin AS min_value, 
                m.seqcache AS cache_value, m.seqcycle AS is_cycled,  
                pg_catalog.obj_description(m.seqrelid, 'pg_class') AS seqcomment,
                u.usename AS seqowner, n.nspname
            FROM
                \"{$sequence}\" AS s, pg_catalog.pg_sequence m,  
                pg_catalog.pg_class c, pg_catalog.pg_user u, pg_catalog.pg_namespace n                       
            WHERE
                c.relowner=u.usesysid AND c.relnamespace=n.oid 
                AND c.oid = m.seqrelid AND c.relname = '{$c_sequence}' AND c.relkind = 'S' AND n.nspname='{$c_schema}' 
                AND n.oid = c.relnamespace";
    

    I changed it to the phpPgAdmin 5.1 version of the same function, i.e. :

                $sql = "
                        SELECT c.relname AS seqname, s.*,
                                pg_catalog.obj_description(s.tableoid, 'pg_class') AS seqcomment,
                                u.usename AS seqowner, n.nspname
                        FROM \"{$sequence}\" AS s, pg_catalog.pg_class c, pg_catalog.pg_user u, pg_catalog.pg_namespace n
                        WHERE c.relowner=u.usesysid AND c.relnamespace=n.oid
                                AND c.relname = '{$c_sequence}' AND c.relkind = 'S' AND n.nspname='{$c_schema}'
                                AND n.oid = c.relnamespace";
    

    Again, I have not fully tested this so please use with caution!!!

     
  • Mark Lane

    Mark Lane - 2019-11-08

    Thanks for the information. Using an older version 5.1 of phppgadmin works. Hopefully there will be an applied patch for newer versions.

     

Log in to post a comment.

MongoDB Logo MongoDB