Re: SHOW TABLES

From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Bruce Momjian <bruce(at)momjian(dot)us>, Bernd Helmle <mailings(at)oopsware(dot)de>, Guillaume Lelarge <guillaume(at)lelarge(dot)info>, jd(at)commandprompt(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 21:46:42
Message-ID: 1279230402.1735.17541.camel@ebony
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, 2010-07-15 at 15:52 -0400, Andrew Dunstan wrote:
> This could presumably be implemented by creating a view to return the
> required information and then making "SHOW TABLES" an alias for
> "select
> * from viewname".
>
> FYI, MS-SQL does this stuff with some stored procedures. I regularly
> use
> sp_columns to fiind out what I'm really being asked to interact with.
> See <http://msdn.microsoft.com/en-us/library/ms182764.aspx>

Sounds good.

OK, how about this:

We write a function to derive the output, which can be executed as a
function if people like that.

We then make SHOW TABLEs a synonym for SELECT * FROM show_function()

That way we get both in one go.

--
Simon Riggs www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Training and Services

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Dimitri Fontaine 2010-07-15 21:59:33 Re: SHOW TABLES
Previous Message Simon Riggs 2010-07-15 21:44:12 Re: SHOW TABLES