Wanted: RelationIsVisible interface - Mailing list pgsql-hackers

From Greg Sabino Mullane
Subject Wanted: RelationIsVisible interface
Date
Msg-id E17dIIH-0006LP-00@smtp6.mindspring.com
Whole thread Raw
Responses Re: Wanted: RelationIsVisible interface
List pgsql-hackers
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


(Moved from 
Re: [PATCHES] small psql patch - show Schema name for \dt \dv \dS)

>> I need something other than RelationIsVisible for psql for the case 
>> when someone says "\d foo" - I need to be able to decide which 
>> "foo" table I should display: pg_temp_1.foo, public.foo, greg.foo, 
> 
> Au contraire, RelationIsVisible is *exactly* what you need.  I'm
> envisioning that where we currently have, say,
> 
>        select ... from pg_class p, ... 
>        where relname like 'foo%' and ...
> 
> we'd write something like
> 
>        select ... from pg_class p, ... 
>        where relname like 'foo%' and pg_relation_is_visible(p.oid) and ...
> 

I see what you are saying, and this is fine for those cases in which the user 
has supplied the schema, but I don't see how it solves the ordering problem. 
If I have a table public.foo and greg.foo, and both are "visible", how will 
psql know which one to show? It should be showing the first in the schema 
search path, in other words, the one that will get effected by a SQL 
statement such as "SELECT * FROM foo;" This is of course the original 
temp table problem with psql.

At any rate, I will play with the RelationIsVisible stuff when somebody 
writes a SQL interface to it (or I write it myself, but that will take 
quite a long time :)

Greg Sabino Mullane  greg@turnstep.com
PGP Key: 0x14964AC8 200208091839

-----BEGIN PGP SIGNATURE-----
Comment: http://www.turnstep.com/pgp.html

iD8DBQE9VESovJuQZxSWSsgRAlHXAJkBqylRDegbwhNxsYr/CPIFYvnRQQCgxC0G
VUDWfnprg1+pcKNZvE1gEzY=
=w7hd
-----END PGP SIGNATURE-----




pgsql-hackers by date:

Previous
From: Justin Clift
Date:
Subject: Re: [SECURITY] DoS attack on backend possible (was: Re:
Next
From: Yuva Chandolu
Date:
Subject: Problem with lower() function