Wanted: RelationIsVisible interface

From: "Greg Sabino Mullane" <greg(at)turnstep(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Wanted: RelationIsVisible interface
Date: 2002-08-09 22:40:34
Message-ID: E17dIIH-0006LP-00@smtp6.mindspring.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)turnstep(dot)com
PGP Key: 0x14964AC8 200208091839

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

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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Yuva Chandolu 2002-08-09 22:40:52 Problem with lower() function
Previous Message Justin Clift 2002-08-09 19:59:45 Re: [SECURITY] DoS attack on backend possible (was: Re: