Re: SHOW TABLES

From: Dimitri Fontaine <dfontaine(at)hi-media(dot)com>
To: Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>
Cc: "David Fetter" <david(at)fetter(dot)org>, "Bruce Momjian" <bruce(at)momjian(dot)us>, "Simon Riggs" <simon(at)2ndQuadrant(dot)com>, <jd(at)commandprompt(dot)com>, "Marc G(dot) Fournier" <scrappy(at)hub(dot)org>, "Guillaume Lelarge" <guillaume(at)lelarge(dot)info>, "Bernd Helmle" <mailings(at)oopsware(dot)de>, <pgsql-hackers(at)postgresql(dot)org>, "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: SHOW TABLES
Date: 2010-07-16 22:45:16
Message-ID: 71383B90-070C-4E56-A78C-3BBCCAC0108B@hi-media.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Le 16 juil. 2010 à 18:42, Kevin Grittner a écrit :
> Like \d, these server-side stored procedures can return a number of
> result sets. Like Robert, I'm skeptical of implementing a
> server-side solution for PostgreSQL which doesn't do the same. I'm
> not clear on whether that's even possible without a new version of
> wire protocol, though.

Well, I think we shouldn't mix it all. My view on that is that we need some easy simple commands in the backend, none of them on its own would mimic \d.

Consider this psql command: psql -E -c '\d'. What I think is that each query you see there could easily become a SHOW subsyntax (from memory, we probably would have SHOW TABLE, SHOW INDEXES ON <table>, SHOW TRIGGERS ON <table>, SHOW CONSTRAINTS ON <table>, etc).

Now, psql would be free to implement its \d in terms of those new queries rather than the full SQL ones it has now, that would be a good first client. Oh and that means the design is about all done already. And that we still are in the one command - one resultset interface. Meaning any libpq driver knows how to deal with the resultset, and that's not parsing text.

I'm all with Simon here, it's not about offering any new capability that we don't already have, it's about having it handy from anywhere. So let's just have an easy syntax in the backend to do all the catalog 'magic' querying psql does, but one query at a time.

Regards,
--
Dimitri Fontaine
PostgreSQL DBA, Architecte

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2010-07-16 23:01:38 Re: ALTER TABLE SET STATISTICS requires AccessExclusiveLock
Previous Message Tom Lane 2010-07-16 22:34:59 Re: log files and permissions