Re: query builder / system objects - Mailing list pgadmin-hackers

From Dave Page
Subject Re: query builder / system objects
Date
Msg-id 03AF4E498C591348A42FC93DEA9661B885C6@mail.vale-housing.co.uk
Whole thread Raw
In response to query builder / system objects  (efesar <efesar@nmia.com>)
Responses Re: query builder / system objects  (efesar <efesar@nmia.com>)
List 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@nmia.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@nmia.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@postgresql.org)
>

pgadmin-hackers by date:

Previous
From: "Dave Page"
Date:
Subject: Re: add const/enumarate in crtpgAppClass.vbs
Next
From: efesar
Date:
Subject: Re: query builder / system objects