Skip site navigation (1) Skip section navigation (2)

pgadmin3 gets oid for schema wrong

From: Richard van den Berg <richard(dot)vandenberg(at)trust-factory(dot)com>
To: pgadmin-support(at)postgresql(dot)org
Subject: pgadmin3 gets oid for schema wrong
Date: 2004-10-15 09:59:33
Message-ID: 416F9F85.5030409@trust-factory.com (view raw or flat)
Thread:
Lists: pgadmin-support
I have this weird problem where pgadmin3 shows empty schema's 
(tables(0), views(0), etc) while they are not empty at all. I upgraded 
to the 1.2.0-0.0+beta2.0 debian package, but the problem persists.

Refreshing the schema causes the schema to disappear from the pgadmin3 
tree. This is the query I see executed when doing the refresh:

SELECT CASE WHEN nspname LIKE 'pg\_temp\_%%' THEN 1
             WHEN nsp.oid<17140 OR nspname like 'pg\_%' THEN 0
             ELSE 2 END as nsptyp,
        nsp.nspname, nsp.oid, pg_get_userbyid(nspowner) AS 
namespaceowner, nspacl, description, has_schema_privilege(nsp.oid, 'CREATE')
  FROM pg_namespace nsp
  LEFT OUTER JOIN pg_description des ON des.objoid=nsp.oid
WHERE nsp.oid=2147483647::oid
ORDER BY 1, nspname

I examined pg_namespace and the oid of the schema actually is 
2518196330. No wonder pgadmin3 thinks it's empty.

Refreshing the "schema's" tree executes this statement:

SELECT CASE WHEN nspname LIKE 'pg\_temp\_%%' THEN 1
             WHEN nsp.oid<17140 OR nspname like 'pg\_%' THEN 0
             ELSE 2 END AS nsptyp,
        nsp.nspname,
        nsp.oid,
        pg_get_userbyid(nspowner) AS namespaceowner,
        nspacl,
        description,
        has_schema_privilege(nsp.oid, 'CREATE')
  FROM pg_namespace nsp
  LEFT OUTER JOIN pg_description des ON des.objoid=nsp.oid
WHERE (nsp.nspname NOT LIKE 'pg\_%' AND nsp.nspname NOT LIKE 
'information_schema')
ORDER BY 1, nspname

The result of this query does list the schema with the correct OID 
(2518196330).

The question is: why does pgadmin3 think the oid for the schema is 
2147483647 ?

I have this problem with a bunch of schema's, which makes pgadmin3 quite 
useless for me at the moment.

Please Cc me in the discussion, as I am not on this list.

Sincerely,

-- 
Richard van den Berg, CISSP

Trust Factory B.V.      | http://www.trust-factory.com/
Bazarstraat 44a         | Phone: +31 70 3620684
NL-2518AK The Hague     | Fax  : +31 70 3603009
The Netherlands         |

Responses

pgadmin-support by date

Next:From: Andreas PflugDate: 2004-10-15 10:51:12
Subject: Re: pgadmin3 gets oid for schema wrong
Previous:From: Andreas PflugDate: 2004-10-15 09:42:38
Subject: Re: ERROR: operator does not exist: - oid

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group