Re: small psql patch - show Schema name for \dt \dv \dS

From: "Greg Sabino Mullane" <greg(at)turnstep(dot)com>
To: pgsql-patches(at)postgresql(dot)org
Subject: Re: small psql patch - show Schema name for \dt \dv \dS
Date: 2002-07-25 01:23:09
Message-ID: E17XXD3-0004A8-00@smtp10.atl.mindspring.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

> It's done that for some time. However, "nsp in current_schemas" isn't
> going to solve psql's problem anyway, since it ignores the fundamental
> issue of visibility: just because an object is in your search path does
> not mean you can see it. It might be masked by a similarly-named object
> earlier in the path.

I think that can be solved by doing an ORDER BY the current_schemas()
results and a LIMIT 1. The bigger problem is the above-mentioned 'nsp in
current_schemas'. I cannot think of an easy way to do this. In other
words, the equivalent of "select * from pg_class where relnamespace
in (current_schemas())" Is there a function in the core to check
an array? The *= construct in contrib/array would be nice, but it
cannot be used to compile psql. My other options are to create a
function, create some internal SQL calls, or do some really ugly
C parsing of the results of "select current_schemas(true)." I
am leaning towards the latter, but a nice internal function that
breaks an array into a table would be great.

Greg Sabino Mullane greg(at)turnstep(dot)com
PGP Key: 0x14964AC8 200207242119

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

iD8DBQE9P1LJvJuQZxSWSsgRAoG3AJ9Daapv2Hixx0JwE3s6Fn2v9sqU+QCghSpc
gPhA2xG2bRH1kXhgnLSm58Y=
=0s2B
-----END PGP SIGNATURE-----

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Rod Taylor 2002-07-25 01:24:08 Re: small psql patch - show Schema name for \dt \dv \dS
Previous Message Neil Conway 2002-07-24 23:21:32 fmtId() and pg_dump