Re: SHOW TABLES

From: Richard Huxton <dev(at)archonet(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: SHOW TABLES
Date: 2010-07-15 19:26:18
Message-ID: 4C3F60DA.3080506@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 15/07/10 19:44, Robert Haas wrote:
> On Jul 15, 2010, at 11:59 AM, Simon Riggs<simon(at)2ndQuadrant(dot)com>
> wrote:
>>
>> I imagined that we would do something similar to EXPLAIN, a set of
>> text rows returned.
>
> That seems rather wretched for machine-parsability, which I think is
> an important property for anything we do in this area. We need to
> think harder about how we could structure this to allow returning
> more than just a tabular result set while still allowing clients easy
> programmatic access to the underlying data.
>
>> It should be possible to migrate \d options to using new outputs,
>> when everything works in a useful manner. Probably not in this
>> release.

Feature sounds useful. I think our \dxx commands have grown a little
unwieldy in the last version or two. Which is not to say you can take \d
away :-)

I was assuming the process would be something like:
1. Move existing \d queries into functions*
2. Convert psql to use those
3. Add "SHOW xxx" and have it return a single query
Have it also issue "NOTICE: from psql, try \dt for more info"

If/when we have multiple sets returned from one query it should be
simple to provide something pretty close to \d... from a single command.

Trying to format the data in the backend is probably just going to
frustrate writers of different clients (of which I think we have quite a
few now).

* These functions could then be back-ported as an admin-pack too for
clients/apps that wanted cross-version compatibility for these sorts of
things.

--
Richard Huxton
Archonet Ltd

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andreas 'ads' Scherbaum 2010-07-15 19:27:30 Re: SHOW TABLES
Previous Message Andrew Dunstan 2010-07-15 19:25:57 Re: SHOW TABLES