Re: query builder / system objects

From: "Dave Page" <dpage(at)vale-housing(dot)co(dot)uk>
To: "efesar" <efesar(at)nmia(dot)com>, "pgadmin-hackers" <pgadmin-hackers(at)postgresql(dot)org>
Subject: Re: query builder / system objects
Date: 2003-03-04 08:55:59
Message-ID: 03AF4E498C591348A42FC93DEA9661B885C6@mail.vale-housing.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

Hi Keith,

This raises a point I'd not thought of before. In pgAdmin II we load all
object, system or not into pgSchema. We then just display whatever is
required. This allows us to use pgSchema as a cache for future queries -
ie. When we look for all functions in the CREATE OPERATOR dialogue, we
just load everything from the Functions collection.

In pgAdmin III, the hierarchy is built on the treeview, so how do we
cache everything in the same way?

I have to be honest, I haven't thought about any of this for a while now
'cos I've been too busy, but I might have some time in the next couple
of weeks.

Anyway, to answer your question, in pgSchema we say (attnum < 1) =
System. To check for views and tables, well this is easy now - if they
are in the pg_catalog, pg_temp or pg_temp_* schemas, then they are
system object. pgAdmin III is being written for 7.3+, so we know schemas
will always exist.

Regards, Dave.

> -----Original Message-----
> From: efesar [mailto:efesar(at)nmia(dot)com]
> Sent: 04 March 2003 00:19
> To: pgadmin-hackers
> Subject: Re: [pgadmin-hackers] query builder / system objects
>
>
> correction
>
> relowner > 1 instead of >=1
>
> // We need to know if we're going to show system objects
> wxString sysobjstr;
> if (!settings->GetShowSystemObjects())
> sysobjstr = " AND relowner > 1 ";
>
> -----Original Message-----
> From: efesar [mailto:efesar(at)nmia(dot)com]
> Sent: Monday, March 03, 2003 5:18 PM
> To: pgadmin-hackers
> Subject: query builder / system objects
>
>
>
> dave,
>
> pga3 question
>
> i can tell system columns easily (and hopefully correctly):
>
> // We need to know if we're going to show system objects
> wxString sysobjstr;
> if (!settings->GetShowSystemObjects())
> sysobjstr = " WHERE attnum >= 0 ";
>
> but is this an adequate way to check for system tables/views?
> this is what i'm using now.
>
> // We need to know if we're going to show system objects
> wxString sysobjstr;
> if (!settings->GetShowSystemObjects())
> sysobjstr = " AND relowner >= 1 ";
>
> the other way i was going to do it was if the first three
> letters are "PG_" but maybe you have a more correct way of doing this.
>
> -keith
>
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to
> majordomo(at)postgresql(dot)org)
>

Responses

Browse pgadmin-hackers by date

  From Date Subject
Next Message efesar 2003-03-04 10:46:01 Re: query builder / system objects
Previous Message efesar 2003-03-04 00:19:02 Re: query builder / system objects