Re: SHOW TABLES

From: "Marc G(dot) Fournier" <scrappy(at)hub(dot)org>
To: Thom Brown <thombrown(at)gmail(dot)com>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, Simon Riggs <simon(at)2ndquadrant(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: SHOW TABLES
Date: 2010-07-15 16:16:34
Message-ID: alpine.BSF.2.00.1007151315330.69490@hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, 15 Jul 2010, Thom Brown wrote:

> On 15 July 2010 17:07, Marc G. Fournier <scrappy(at)hub(dot)org> wrote:
>> On Thu, 15 Jul 2010, Thom Brown wrote:
>>
>>> If it's only a psql problem, why implement it as SQL?  Is it just so we're
>>> not adding keywords specifically to psql?  In that case, it shouldn't
>>> support QUIT.
>>
>> Personally, I think this is somethign that should go into the backend ...
>> I'd like to be able to write perl scripts that talk to the backend without
>> having to remember all the various system tables I need to query / join to
>> get the same results as \d gives me in psql ... same for any interface
>> language, really ...
>>
>
> Isn't that what the information_schema catalog is for?

I'd rather write:

SHOW TABLES;

then:

SELECT table_name
FROM information_schema.tables
WHERE table_type = 'BASE TABLE'
AND table_schema NOT IN
('pg_catalog', 'information_schema');

And, the latter, unless I'm doing it regularly, is alot harder to remember
then the former ...

----
Marc G. Fournier Hub.Org Hosting Solutions S.A.
scrappy(at)hub(dot)org http://www.hub.org

Yahoo:yscrappy Skype: hub.org ICQ:7615664 MSN:scrappy(at)hub(dot)org

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Joshua D. Drake 2010-07-15 16:19:51 Re: SHOW TABLES
Previous Message Robert Haas 2010-07-15 16:10:35 Re: SHOW TABLES