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

Re: pgAdmin: blank header in the "Edit Data" window if table OID changes

From: Guillaume Lelarge <guillaume(at)lelarge(dot)info>
To: Steven Elliott <selliott4(at)austin(dot)rr(dot)com>
Cc: pgadmin-support(at)postgresql(dot)org
Subject: Re: pgAdmin: blank header in the "Edit Data" window if table OID changes
Date: 2011-04-17 12:55:56
Message-ID: 4DAAE35C.9070604@lelarge.info (view raw or flat)
Thread:
Lists: pgadmin-support
Le 17/04/2011 07:48, Steven Elliott a écrit :
> I noticed that the headers (column names and types at the top of the
> table) are blank in the "Edit Data" window (displayed if "View the data
> in the selected object" button is pressed) if the table OID changes
> while pgAdmin is running.  I have this problem (changed table OID) when
> I recreate a database from a dump while pgAdmin is running.
> 

Yeah, this is an issue we would like to fix. There is already a ticket
on it (http://code.pgadmin.org/trac/ticket/44). Ashesh was supposed to
work on it, but I guess he has already too much work :)

> Turning on query logging reveals that the issue is that pgAdmin is using
> cached OIDs.  Refreshing the table (pressing F5 while the table is
> selected) fixes the problem.  Refreshing also causes pgAdmin to use the
> updated OID.
> 

That's true.

> There are various queries involved in displaying the "Edit Data" window,
> but consider this one:
>   SELECT attisdropped 
>   FROM pg_attribute 
>   WHERE attnum > 0 AND attrelid=36214::oid
>   ORDER BY attnum;
> In this case "36214" is the cached and possibly stale table OID.  If the
> OID is stale then the above returns zero rows, so one possibility is to
> reload the table OIDs if the this query returns less rows than expected.
> Another is to use the table name in each query, so the above becomes (if
> the table is named "my-table"):
>   SELECT attisdropped 
>   FROM pg_attribute 
>   WHERE attnum > 0 AND attrelid='my-table'::regclass
>   ORDER BY attnum;
> But I suppose that is slower.
> 

Slower and not less exposed to bugs. What happened if you rename the
table? with OID it still works.

> I've seen this problem on Fedora 13 i686 as well as Fedora 14 x86_64.
> I've seen it with pgAdmin version 1.10.5 as well as latest GIT as of
> 2011-04-17.
> 

Yeah, this is a long lasting issue.

> Let me know if there is anything else I can tell you that would be
> helpful.
> 

That's already a really good bug report.


-- 
Guillaume
 http://www.postgresql.fr
 http://dalibo.com

In response to

pgadmin-support by date

Next:From: Guillaume LelargeDate: 2011-04-17 13:17:05
Subject: Re: PGAdmin - saving result sets from queries where one or more columns are of the type boolean
Previous:From: Steven ElliottDate: 2011-04-17 05:48:34
Subject: pgAdmin: blank header in the "Edit Data" window if table OID changes

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