From: SourceForge.net <no...@so...> - 2009-02-19 05:38:14
|
Bugs item #1731971, was opened at 2007-06-06 19:50 Message generated for change (Comment added) made by mbahjat You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=418980&aid=1731971&group_id=37132 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Sequences Group: 4.1.2 Status: Open Resolution: None Priority: 5 Private: No Submitted By: storozhilov (storozhilov) Assigned to: Guillaume `ioguix` de Rorthais (ioguix) Summary: Sequences owned by another users are not displayed Initial Comment: Sequences owned by another users (not the database owner) are not displayed in phpPgAdmin... Same functions are displayed, but with empty value in "owner" column. ---------------------------------------------------------------------- Comment By: Mustafa Bahjat (mbahjat) Date: 2009-02-19 13:38 Message: Am experiencing a similar problem on version 4.2.2. I have a database with tables and sequences owned by a database role that I added. All the tables show up fine but the sequences don't. I modified the code in classes/database/Postgres80.php from function getSequences($all = false) { if ($all) { // Exclude pg_catalog and information_schema tables $sql = "SELECT n.nspname, c.relname AS seqname, u.usename AS seqowner FROM 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.relkind = 'S' AND n.nspname NOT IN ('pg_catalog', 'information_schema', 'pg_toast') ORDER BY nspname, seqname"; } else { $sql = "SELECT c.relname AS seqname, u.usename AS seqowner, pg_catalog.obj_description(c.oid, 'pg_class') AS seqcomment, (SELECT spcname FROM pg_catalog.pg_tablespace pt WHERE pt.oid=c.reltablespace) AS tablespace FROM 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.relkind = 'S' AND n.nspname='{$this->_schema}' ORDER BY seqname"; } return $this->selectSet( $sql ); } to: function getSequences($all = false) { if ($all) { // Exclude pg_catalog and information_schema tables $sql = "SELECT n.nspname, c.relname AS seqname, r.rolname AS seqowner FROM pg_catalog.pg_class c, pg_catalog.pg_roles r, pg_catalog.pg_namespace n WHERE c.relowner=r.oid AND c.relnamespace=n.oid AND c.relkind = 'S' AND n.nspname NOT IN ('pg_catalog', 'information_schema', 'pg_toast') ORDER BY nspname, seqname"; } else { $sql = "SELECT c.relname AS seqname, u.usename AS seqowner, pg_catalog.obj_description(c.oid, 'pg_class') AS seqcomment, (SELECT spcname FROM pg_catalog.pg_tablespace pt WHERE pt.oid=c.reltablespace) AS tablespace FROM pg_catalog.pg_class c, pg_catalog.pg_roles r, pg_catalog.pg_namespace n WHERE c.relowner=r.oid AND c.relnamespace=n.oid AND c.relkind = 'S' AND n.nspname='{$this->_schema}' ORDER BY seqname"; } return $this->selectSet( $sql ); } and it seems to do the trick for me... Am not sure if this fix is correct relative to the big pictures.. ---------------------------------------------------------------------- Comment By: Robert Treat (xzilla) Date: 2008-07-14 12:03 Message: Logged In: YES user_id=204589 Originator: NO I guess another question would be if this is still valid against 4.2? Might be time to mark this pending... ---------------------------------------------------------------------- Comment By: Guillaume `ioguix` de Rorthais (ioguix) Date: 2007-10-19 03:10 Message: Logged In: YES user_id=1489394 Originator: NO Hello, Could you give us some more details and some steps to reproduce this behaviour ? I have some sequences which are own by other users than the db owner which are shown in ppa... ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=418980&aid=1731971&group_id=37132 |