-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Here is my first pass at supporting schemas within psql. This is by no
means a finished product, but at least allows psql to be used again
until the details get ironed out. Here are the assumptions I have made:
Schema names are always shown, either in a new column (e.g. \d) or
as part of the full relation name (e.g. \d foo).
For \d foo, two formats are accepted: schema.name simply looks up
the relation "name" in the schema "schema". If no schema is given,
just a "name", then psql will show a temporary relation by that name,
if one exists, otherwise it will check the current schema.
\dS basically returns relations belonging to all schemas (not relations)
starting with "pg_" that are not in the set "pg_temp_". I toyed with making
it more specific and saying that \dS only returns items from the pg_catalog
schema. Currently, they are the same, but should \dS ever return
things outside of pg_catalog? I'm guessing yes, otherwise there would
be no way to list them.
For viewing a list of things with \d, temporary tables are always shown
first, then the rest of the schemas alphabetically. Within those, the
ordering is then by name, and finally by reltype. Further ordering by
owner name is not needed.
This leaves out a lot (such as \z) but I wanted to strighten out the
details on the \d family before moving on.
1953e84ba31eb0a761f2adfc052aca2a psql_schema.diff
Greg Sabino Mullane greg@turnstep.com
PGP Key: 0x14964AC8 200206221124
-----BEGIN PGP SIGNATURE-----
Comment: http://www.turnstep.com/pgp.html
iD8DBQE9FJcZvJuQZxSWSsgRAta4AKDtym0E7SI4zhmLXtmBP6c1jZGmZQCfdmYZ
x6+AyDcEiiezMChy5BZHFlA=
=Hr0T
-----END PGP SIGNATURE-----