Re: [HACKERS] SHOW TABLES

2010-09-21 Thread Robert Haas
On Tue, Sep 21, 2010 at 4:52 AM, Boszormenyi Zoltan wrote: > I think it's related to making this work: >    SELECT * FROM db.schema.table; Which is a non-starter, I think. Every function in the system that thinks an OID uniquely identifies a database object would need to modified, or else you'd

Re: [HACKERS] SHOW TABLES

2010-09-21 Thread Boszormenyi Zoltan
Guillaume Lelarge írta: > Le 15/07/2010 17:48, Joshua D. Drake a écrit : > >> On Thu, 2010-07-15 at 16:20 +0100, Simon Riggs wrote: >> >>> On Thu, 2010-07-15 at 11:05 -0400, Tom Lane wrote: >>> Simon Riggs writes: > The biggest turn off that most people experi

Re: [HACKERS] SHOW TABLES

2010-08-09 Thread Kevin Grittner
Bruce Momjian wrote: > Kevin Grittner wrote: >> I can't picture anything which could be done with views which >> would allow me to issue one statement and see everything of >> interest about a table (etc.). You know: tablespace, owner, >> permissions, columns, primary key, foreign keys, check >

Re: [HACKERS] SHOW TABLES

2010-08-09 Thread Bruce Momjian
Kevin Grittner wrote: > Stefan Kaltenbrunner wrote: > > On 07/18/2010 08:58 PM, Andres Freund wrote: > > >> I am quite a bit surprised about all this discussion. I have a > >> very hard time we will find anything people agree about and can > >> remember well enough to be usefull for both manual

Re: [HACKERS] SHOW TABLES

2010-08-09 Thread Robert Haas
On Mon, Aug 9, 2010 at 5:42 PM, Bruce Momjian wrote: > Sorry for the late reply.  If we are going to end up recreating SQL, we > might as well just keep the backslash mess we have, or tell them to use > SQL for the complex queries.  My point was that we might find that what > we cook up is as comp

Re: [HACKERS] SHOW TABLES

2010-08-09 Thread Simon Riggs
On Mon, 2010-08-09 at 17:42 -0400, Bruce Momjian wrote: > Robert Haas wrote: > > On Sat, Jul 17, 2010 at 11:14 PM, Bruce Momjian wrote: > > > Robert Haas wrote: > > >> I'd like to be able to list comments on objects of a particular type. > > >> And, yeah, I'd like to be able to list all the aggreg

Re: [HACKERS] SHOW TABLES

2010-08-09 Thread Bruce Momjian
Robert Haas wrote: > On Sat, Jul 17, 2010 at 11:14 PM, Bruce Momjian wrote: > > Robert Haas wrote: > >> I'd like to be able to list comments on objects of a particular type. > >> And, yeah, I'd like to be able to list all the aggregates that take a > >> numeric argument, or all the functions that

Re: [HACKERS] SHOW TABLES

2010-07-19 Thread Kevin Grittner
David Fetter wrote: > Would something like this do? Thanks to Andrew Gierth for helping > me figure out how to get this working :) > > CREATE OR REPLACE FUNCTION multi_result() > RETURNS SETOF REFCURSOR With appropriate tweaks to JDBC and the other drivers, this would cover a lot of ground.

Re: [HACKERS] SHOW TABLES

2010-07-19 Thread David Fetter
On Mon, Jul 19, 2010 at 09:31:06AM -0500, Kevin Grittner wrote: > >Stephen Frost wrote: > > > You think that the users of the libpq() interface (or even the > > protocol itself) are going to handle getting \dt-type output back > > somehow..? > > If you look back in the thread, you'll see that

Re: [HACKERS] SHOW TABLES

2010-07-19 Thread Greg Sabino Mullane
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 David Fetter wrote: >> No arguments there, but that's the nature of the beast. I don't >> think it's as bad as is made out, however, as \d covers 99% of >> everyday usage and certainly the "show tables" that started >> this thread. > It cove

Re: [HACKERS] SHOW TABLES

2010-07-19 Thread Joshua D. Drake
On Mon, 2010-07-19 at 10:23 -0700, David Fetter wrote: > On Mon, Jul 19, 2010 at 02:12:19PM -, Greg Sabino Mullane wrote: > > > > -BEGIN PGP SIGNED MESSAGE- > > Hash: RIPEMD160 > > > > > > > 1. \d isn't exactly the most intuitive thing ever > > > > Seems fairly mnemomic to me (d=de

Re: [HACKERS] SHOW TABLES

2010-07-19 Thread David Fetter
On Mon, Jul 19, 2010 at 02:12:19PM -, Greg Sabino Mullane wrote: > > -BEGIN PGP SIGNED MESSAGE- > Hash: RIPEMD160 > > > > 1. \d isn't exactly the most intuitive thing ever > > Seems fairly mnemomic to me (d=describe) and it packs a > *lot* of information into a single letter (see

Re: [HACKERS] SHOW TABLES

2010-07-19 Thread Robert Haas
On Mon, Jul 19, 2010 at 10:25 AM, Greg Sabino Mullane wrote: >> in the "alphabet soup" paragraph above.  I don't think there's >> anything WRONG with letting "\dFp" show text search dictionaries and >> "\dfwS+" list system window functions with additional detail - but I'd >> like an alternative th

Re: [HACKERS] SHOW TABLES

2010-07-19 Thread Stephen Frost
* Kevin Grittner (kevin.gritt...@wicourts.gov) wrote: > I know, though, that the JDBC spec supports such things -- you can > keep pulling ResultSet objects off the wire, each with its own > distinct set of columns. (That is, each ResultSet has its own > ResultSetMetaData which specifies how many c

Re: [HACKERS] SHOW TABLES

2010-07-19 Thread Kevin Grittner
>Stephen Frost wrote: > You think that the users of the libpq() interface (or even the > protocol itself) are going to handle getting \dt-type output back > somehow..? If you look back in the thread, you'll see that I admitted my ignorance of whether this could be properly implemented in the b

Re: [HACKERS] SHOW TABLES

2010-07-19 Thread Greg Sabino Mullane
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 Kevin Grittner wrote: > Any solution which only works within psql isn't a solution for a > large part of the problem space people are trying to address. One > important goal is that if someone spends a day to whip up a GUI > query tool (as I d

Re: [HACKERS] SHOW TABLES

2010-07-19 Thread Greg Sabino Mullane
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 Robert Haas (robertmh...@gmail.com) wrote: > I think "LIST COMMENTS ON SYSTEM AGGREGATES" would be an epic > step forward in usability. Perhaps. But it would behoove you to come up with a less er... arcane example. I've been using Postgres a l

Re: [HACKERS] SHOW TABLES

2010-07-19 Thread Greg Sabino Mullane
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 > 1. \d isn't exactly the most intuitive thing ever > Seems fairly mnemomic to me (d=describe) and it packs a *lot* of information into a single letter (see below). Things that are done often should have short keystrokes, and not require le

Re: [HACKERS] SHOW TABLES

2010-07-18 Thread Stephen Frost
Kevin, * Kevin Grittner (kevin.gritt...@wicourts.gov) wrote: > I can't picture anything which could be done with views which would > allow me to issue one statement and see everything of interest about > a table (etc.). You know: tablespace, owner, permissions, columns, > primary key, foreign key

Re: [HACKERS] SHOW TABLES

2010-07-18 Thread Andres Freund
Hi Kevin, On Sunday 18 July 2010 21:24:25 Kevin Grittner wrote: > Stefan Kaltenbrunner wrote: > > On 07/18/2010 08:58 PM, Andres Freund wrote: > >> I am quite a bit surprised about all this discussion. I have a > >> very hard time we will find anything people agree about and can > >> remember wel

Re: [HACKERS] SHOW TABLES

2010-07-18 Thread Stefan Kaltenbrunner
On 07/18/2010 09:00 PM, Kevin Grittner wrote: Dimitri Fontaine wrote: So what we'd need first is a series of named queries, which I think psql provides for. Any solution which only works within psql isn't a solution for a large part of the problem space people are trying to address. One imp

Re: [HACKERS] SHOW TABLES

2010-07-18 Thread Simon Riggs
On Sun, 2010-07-18 at 20:39 +0200, Dimitri Fontaine wrote: > SHOW TABLE foo; Yes > SHOW TABLES WHERE tablename ~ 'foo'; > > SHOW ANY TABLE > GROUP BY tablename > HAVING array_agg(attributes) @> array['date'::regtype, > 'time'::regtype]; For me, realistically, No. Simplifying SQL should b

Re: [HACKERS] SHOW TABLES

2010-07-18 Thread Dimitri Fontaine
Le 18 juil. 2010 à 21:21, Andres Freund a écrit : > Providing an easy wrapper is something I could agree without much problems > (as > it doesnt touch me). But starting several new toplevel commands which do not > give everything (i.e. the ability to selectively use columns) but still want > to

Re: [HACKERS] SHOW TABLES

2010-07-18 Thread Dimitri Fontaine
Le 18 juil. 2010 à 20:58, Andres Freund a écrit : > On Sunday 18 July 2010 20:39:07 Dimitri Fontaine wrote: >> SHOW ANY TABLE >> GROUP BY tablename >> HAVING array_agg(attributes) @> array['date'::regtype, 'time'::regtype]; > Why is that in *any* way better than > > SELECT * > FROM meta.tables >

Re: [HACKERS] SHOW TABLES

2010-07-18 Thread Dimitri Fontaine
Le 18 juil. 2010 à 21:00, Kevin Grittner a écrit : > Dimitri Fontaine wrote: > >> So what we'd need first is a series of named queries, which I >> think psql provides for. > > Any solution which only works within psql isn't a solution for a > large part of the problem space people are trying to

Re: [HACKERS] SHOW TABLES

2010-07-18 Thread Kevin Grittner
Stefan Kaltenbrunner wrote: > On 07/18/2010 08:58 PM, Andres Freund wrote: >> I am quite a bit surprised about all this discussion. I have a >> very hard time we will find anything people agree about and can >> remember well enough to be usefull for both manual and automatic >> processing. >> >>

Re: [HACKERS] SHOW TABLES

2010-07-18 Thread Andres Freund
Hi, On Sunday 18 July 2010 21:02:59 Rob Wultsch wrote: > On Sun, Jul 18, 2010 at 11:58 AM, Andres Freund wrote: > > On Sunday 18 July 2010 20:39:07 Dimitri Fontaine wrote: > >> SHOW ANY TABLE > >> GROUP BY tablename > >> HAVING array_agg(attributes) @> array['date'::regtype, > >> 'time'::regtyp

Re: [HACKERS] SHOW TABLES

2010-07-18 Thread Stefan Kaltenbrunner
On 07/18/2010 08:58 PM, Andres Freund wrote: On Sunday 18 July 2010 20:39:07 Dimitri Fontaine wrote: SHOW ANY TABLE GROUP BY tablename HAVING array_agg(attributes) @> array['date'::regtype, 'time'::regtype]; Why is that in *any* way better than SELECT * FROM meta.tables ... Oh. The second

Re: [HACKERS] SHOW TABLES

2010-07-18 Thread Rob Wultsch
On Sun, Jul 18, 2010 at 11:58 AM, Andres Freund wrote: > On Sunday 18 July 2010 20:39:07 Dimitri Fontaine wrote: >> SHOW ANY TABLE >> GROUP BY tablename >>   HAVING array_agg(attributes) @> array['date'::regtype, 'time'::regtype]; > Why is that in *any* way better than > > SELECT * > FROM meta.tab

Re: [HACKERS] SHOW TABLES

2010-07-18 Thread Kevin Grittner
Dimitri Fontaine wrote: > So what we'd need first is a series of named queries, which I > think psql provides for. Any solution which only works within psql isn't a solution for a large part of the problem space people are trying to address. One important goal is that if someone spends a day

Re: [HACKERS] SHOW TABLES

2010-07-18 Thread Andres Freund
On Sunday 18 July 2010 20:39:07 Dimitri Fontaine wrote: > SHOW ANY TABLE > GROUP BY tablename > HAVING array_agg(attributes) @> array['date'::regtype, 'time'::regtype]; Why is that in *any* way better than SELECT * FROM meta.tables ... Oh. The second looks like something I know. Oh. My editor

Re: [HACKERS] SHOW TABLES

2010-07-18 Thread Dimitri Fontaine
Hi, Le 18 juil. 2010 à 05:41, Robert Haas a écrit : > On Sat, Jul 17, 2010 at 11:14 PM, Bruce Momjian wrote: >> I am concerned that implementing a command syntax to show complex output >> like above effectively means re-implementing a subset of SQL, and that >> subset will never be as flexible. >

Re: [HACKERS] SHOW TABLES

2010-07-17 Thread Robert Haas
On Sat, Jul 17, 2010 at 11:14 PM, Bruce Momjian wrote: > Robert Haas wrote: >> I'd like to be able to list comments on objects of a particular type. >> And, yeah, I'd like to be able to list all the aggregates that take a >> numeric argument, or all the functions that take, say, an argument of >>

Re: [HACKERS] SHOW TABLES

2010-07-17 Thread Bruce Momjian
Robert Haas wrote: > I'd like to be able to list comments on objects of a particular type. > And, yeah, I'd like to be able to list all the aggregates that take a > numeric argument, or all the functions that take, say, an argument of > type internal. Right now, this is an ENORMOUS pain in the nec

Re: [HACKERS] SHOW TABLES

2010-07-17 Thread Robert Haas
On Sat, Jul 17, 2010 at 5:30 PM, Stefan Kaltenbrunner wrote: > On 07/17/2010 04:02 PM, Robert Haas wrote: >> On Jul 16, 2010, at 11:02 PM, Stephen Frost  wrote: >>> * Robert Haas (robertmh...@gmail.com) wrote: Why must the backslash commands be more powerful than any alternative we

Re: [HACKERS] SHOW TABLES

2010-07-17 Thread Joshua D. Drake
On Sat, 2010-07-17 at 23:30 +0200, Stefan Kaltenbrunner wrote: > On 07/17/2010 04:02 PM, Robert Haas wrote: > > On Jul 16, 2010, at 11:02 PM, Stephen Frost wrote: > >> * Robert Haas (robertmh...@gmail.com) wrote: > >>> Why must the backslash commands be more powerful than any alternative > >>> we

Re: [HACKERS] SHOW TABLES

2010-07-17 Thread Stefan Kaltenbrunner
On 07/17/2010 04:02 PM, Robert Haas wrote: On Jul 16, 2010, at 11:02 PM, Stephen Frost wrote: * Robert Haas (robertmh...@gmail.com) wrote: Why must the backslash commands be more powerful than any alternative we might come up with? Because they encode alot of information in a character- some

Re: [HACKERS] SHOW TABLES

2010-07-17 Thread Pavel Stehule
2010/7/17 Joshua D. Drake : > On Sat, 2010-07-17 at 09:02 -0500, Robert Haas wrote: >> On Jul 16, 2010, at 11:02 PM, Stephen Frost wrote: >> > * Robert Haas (robertmh...@gmail.com) wrote: >> >> Why must the backslash commands be more powerful than any alternative >> >> we might come up with? >> >

Re: [HACKERS] SHOW TABLES

2010-07-17 Thread Joshua D. Drake
On Sat, 2010-07-17 at 09:02 -0500, Robert Haas wrote: > On Jul 16, 2010, at 11:02 PM, Stephen Frost wrote: > > * Robert Haas (robertmh...@gmail.com) wrote: > >> Why must the backslash commands be more powerful than any alternative > >> we might come up with? > > > > Because they encode alot of in

Re: [HACKERS] SHOW TABLES

2010-07-17 Thread Kevin Grittner
Tim Landscheidt wrote: > One major flaw I see is that the fractional precision is > fixed. Not only petrol stations split cents. Well, I've never paid a petrol station a fraction of a cent; I've only seen *rates* of money per some unit of measure with fractional cents. If you're being accurat

Re: [HACKERS] SHOW TABLES

2010-07-17 Thread Robert Haas
On Jul 16, 2010, at 11:02 PM, Stephen Frost wrote: > * Robert Haas (robertmh...@gmail.com) wrote: >> Why must the backslash commands be more powerful than any alternative >> we might come up with? > > Because they encode alot of information in a character- something which > is next to impossible

Re: [HACKERS] SHOW TABLES

2010-07-16 Thread Stephen Frost
* Robert Haas (robertmh...@gmail.com) wrote: > Why must the backslash commands be more powerful than any alternative > we might come up with? Because they encode alot of information in a character- something which is next to impossible to do in "english". Consider 'standard' perl vs. perl w/ 'use

Re: [HACKERS] SHOW TABLES

2010-07-16 Thread Robert Haas
On Fri, Jul 16, 2010 at 1:52 PM, Heikki Linnakangas wrote: > That's for MySQL. I come from a DB2 background, and when I started using > psql years ago, I often typed "LIST TABLES" without thinking much about it. > Not SHOW TABLES, but LIST TABLES. > > I bet Oracle users coming to PostgreSQL will t

Re: [HACKERS] SHOW TABLES

2010-07-16 Thread Tim Landscheidt
"Kevin Grittner" wrote: >>> postgres=# SHOW ME THE MONEY; >>> WARNING: THE MONEY is deprecated in this version of Postgres and >>> may be discarded in a future version >>> HINT: Use SHOW ME THE NUMERIC with the desired precision instead. >> Funny, but no longer true: >> http://www.postgresql.o

Re: [HACKERS] SHOW TABLES

2010-07-16 Thread Dimitri Fontaine
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 wit

Re: [HACKERS] SHOW TABLES

2010-07-16 Thread Kevin Grittner
"Joshua D. Drake" wrote: > On Sat, 2010-07-17 at 07:36 +1000, Brendan Jurd wrote: >> postgres=# SHOW ME THE MONEY; >> WARNING: THE MONEY is deprecated in this version of Postgres and >> may be discarded in a future version >> HINT: Use SHOW ME THE NUMERIC with the desired precision instead. >

Re: [HACKERS] SHOW TABLES

2010-07-16 Thread Stephen Frost
* Heikki Linnakangas (heikki.linnakan...@enterprisedb.com) wrote: > I'm not sure I buy that, but even if it's true, it doesn't seem fair to > do a favor to one group of users, leaving the rest stranded and excluded > forever. Even if SHOW TABLES has a bigger mind-share than the others, > sure

Re: [HACKERS] SHOW TABLES

2010-07-16 Thread Joshua D. Drake
On Sat, 2010-07-17 at 07:36 +1000, Brendan Jurd wrote: > On 17 July 2010 07:26, Joshua D. Drake wrote: > > Yes. We should provide a single, well described grammar for interacting > > with objects in the database regardless of client. I should be able to > > open ANY SQL terminal, and type SHOW ME

Re: [HACKERS] SHOW TABLES

2010-07-16 Thread Brendan Jurd
On 17 July 2010 07:26, Joshua D. Drake wrote: > Yes. We should provide a single, well described grammar for interacting > with objects in the database regardless of client. I should be able to > open ANY SQL terminal, and type SHOW ME THE MONEY and have Benjamins > fall out. postgres=# SHOW ME TH

Re: [HACKERS] SHOW TABLES

2010-07-16 Thread Joshua D. Drake
On Fri, 2010-07-16 at 19:32 +0100, Simon Riggs wrote: > That's a very sensible suggestion, we should give a hint for all common > commands SHOW, LIST, etc., even though we pick just one to implement. > > > That way we're not on the hook to maintain them forever, and we > > will be > > > doing

Re: [HACKERS] SHOW TABLES

2010-07-16 Thread Tim Landscheidt
Simon Riggs wrote: > [...] > Light switches are usually at shoulder height next to a door. Our light > switches are 2 metres up, on the far side of the room. People are sick > of banging their knees on furniture while trying to grope for the light. > The light switch isn't so much hard to use, it

Re: [HACKERS] SHOW TABLES

2010-07-16 Thread Heikki Linnakangas
On 16/07/10 21:32, Simon Riggs wrote: On Fri, 2010-07-16 at 20:52 +0300, Heikki Linnakangas wrote: I have nothing against SHOW TABLES ...but SHOW wins, based on numbers of people expecting that I'm not sure I buy that, but even if it's true, it doesn't seem fair to do a favor to one group o

Re: [HACKERS] SHOW TABLES

2010-07-16 Thread Simon Riggs
On Fri, 2010-07-16 at 20:52 +0300, Heikki Linnakangas wrote: > On 16/07/10 20:11, Rob Wultsch wrote: > > On Fri, Jul 16, 2010 at 9:56 AM, Robert Haas wrote: > >> For committers. > > > > Perhaps this discussions should be moved to the General list in order > > to poll the userbase. > > > > My .02 i

Re: [HACKERS] SHOW TABLES

2010-07-16 Thread Rob Wultsch
On Fri, Jul 16, 2010 at 10:52 AM, Heikki Linnakangas wrote: > On 16/07/10 20:11, Rob Wultsch wrote: >> >> On Fri, Jul 16, 2010 at 9:56 AM, Robert Haas >>  wrote: >>> >>> For committers. >> >> Perhaps this discussions should be moved to the General list in order >> to poll the userbase. >> >> My .0

Re: [HACKERS] SHOW TABLES

2010-07-16 Thread Heikki Linnakangas
On 16/07/10 20:11, Rob Wultsch wrote: On Fri, Jul 16, 2010 at 9:56 AM, Robert Haas wrote: For committers. Perhaps this discussions should be moved to the General list in order to poll the userbase. My .02 is that SHOW commands (even if they are not compatible) would make it much easier for m

Re: [HACKERS] SHOW TABLES

2010-07-16 Thread Bruce Momjian
Chris Browne wrote: > - I'd sure like to be able to write queries that *don't* involve >array smashing or using "grep" on \z output to analyze object >permissions. The \z output is an embarrassment, no question about it in my mind. -- Bruce Momjian http://momjian.

Re: [HACKERS] SHOW TABLES

2010-07-16 Thread Kevin Grittner
"Marc G. Fournier" wrote: > Haven't experienced Sybase for 2 years in my last job, I can tell > you that the sp_* commands are definitely non-intuitive :( In general, I'd agree; although I think I got used to them about as fast as the PostgreSQL backslash commands. In the particular case of s

Re: [HACKERS] SHOW TABLES

2010-07-16 Thread Chris Browne
si...@2ndquadrant.com (Simon Riggs) writes: > Just for the record, I've never ever met anyone that said "Oh, this > \d syntax makes so much sense. I'm a real convert to Postgres now > you've shown me this". The reaction is always the opposite one; > always negative. Which detracts from our efforts

Re: [HACKERS] SHOW TABLES

2010-07-16 Thread Marc G. Fournier
On Fri, 16 Jul 2010, Simon Riggs wrote: SQLServer and Sybase use sp_ procedures for this Haven't experienced Sybase for 2 years in my last job, I can tell you that the sp_* commands are definitely non-intuitive :( Marc G. FournierHub.Org Hosting Solutions S.A. s

Re: [HACKERS] SHOW TABLES

2010-07-16 Thread Rob Wultsch
On Fri, Jul 16, 2010 at 9:56 AM, Robert Haas wrote: > For committers. Perhaps this discussions should be moved to the General list in order to poll the userbase. My .02 is that SHOW commands (even if they are not compatible) would make it much easier for me to make an argument to my boss to at l

Re: [HACKERS] SHOW TABLES

2010-07-16 Thread Robert Haas
On Jul 16, 2010, at 7:43 AM, Bruce Momjian wrote: > Andrew Dunstan wrote: >> >> Bruce Momjian wrote: >>> I assume SHOW TABLES would only be useful for interactive terminal >>> sesssions, not for application code (which should use >>> information_schema), so what non-psql interactive terminal prog

Re: [HACKERS] SHOW TABLES

2010-07-16 Thread Simon Riggs
On Fri, 2010-07-16 at 12:25 -0400, Bruce Momjian wrote: > Simon Riggs wrote: > > On Fri, 2010-07-16 at 12:16 -0400, Bruce Momjian wrote: > > > > > Really? What are the other syntaxes? > > > > SHOW TABLES > > That is MySQL? Do does every other RDBMs also use that, as David > suggested? He didn

Re: [HACKERS] SHOW TABLES

2010-07-16 Thread Kevin Grittner
Bruce Momjian wrote: > What are the other syntaxes? For Sybase ASE sp_help and other stored procedures, see: http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.infocenter.dc36273.1550/html/sprocs/X85190.htm Like \d, these server-side stored procedures can return a number of resu

Re: [HACKERS] SHOW TABLES

2010-07-16 Thread Bruce Momjian
Simon Riggs wrote: > On Fri, 2010-07-16 at 12:16 -0400, Bruce Momjian wrote: > > > Really? What are the other syntaxes? > > SHOW TABLES That is MySQL? Do does every other RDBMs also use that, as David suggested? -- Bruce Momjian http://momjian.us EnterpriseDB

Re: [HACKERS] SHOW TABLES

2010-07-16 Thread Aidan Van Dyk
* Simon Riggs [100716 12:24]: > On Fri, 2010-07-16 at 12:16 -0400, Bruce Momjian wrote: > > > Really? What are the other syntaxes? > > SHOW TABLES Obviously, only for some $value of $other... The 3 database I have access to: [DataDirect][ODBC SQL Server Driver][SQL Server]Could not f

Re: [HACKERS] SHOW TABLES

2010-07-16 Thread Simon Riggs
On Fri, 2010-07-16 at 12:16 -0400, Bruce Momjian wrote: > Really? What are the other syntaxes? SHOW TABLES -- Simon Riggs www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Training and Services -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make

Re: [HACKERS] SHOW TABLES

2010-07-16 Thread Bruce Momjian
David Fetter wrote: > On Fri, Jul 16, 2010 at 12:04:01PM -0400, Bruce Momjian wrote: > > Marc G. Fournier wrote: > > > On Fri, 16 Jul 2010, Bruce Momjian wrote: > > > > > > >> There are many tools that can access Postgres. Some are libpq programs, > > > >> though there are command line versions in

Re: [HACKERS] SHOW TABLES

2010-07-16 Thread David E. Wheeler
On Jul 16, 2010, at 9:09 AM, David Fetter wrote: >> Clarification, do enough people use non-psql command line tools to >> warrant putting this in the backend? > > Yes. Such backend stuff is in every RDBMS except ours. I admit that I had to do a *lot* of work to write the schema-testing function

Re: [HACKERS] SHOW TABLES

2010-07-16 Thread David Fetter
On Fri, Jul 16, 2010 at 12:04:01PM -0400, Bruce Momjian wrote: > Marc G. Fournier wrote: > > On Fri, 16 Jul 2010, Bruce Momjian wrote: > > > > >> There are many tools that can access Postgres. Some are libpq programs, > > >> though there are command line versions in every environment: java, > > >>

Re: [HACKERS] SHOW TABLES

2010-07-16 Thread Bruce Momjian
Marc G. Fournier wrote: > On Fri, 16 Jul 2010, Bruce Momjian wrote: > > >> There are many tools that can access Postgres. Some are libpq programs, > >> though there are command line versions in every environment: java, > >> python, etc.. > > > > Yeah, but do enough people use them to warrant putti

Re: [HACKERS] SHOW TABLES

2010-07-16 Thread Marc G. Fournier
On Fri, 16 Jul 2010, Bruce Momjian wrote: There are many tools that can access Postgres. Some are libpq programs, though there are command line versions in every environment: java, python, etc.. Yeah, but do enough people use them to warrant putting this in the backend? I may have lost the g

Re: [HACKERS] SHOW TABLES

2010-07-16 Thread David Fetter
On Fri, Jul 16, 2010 at 11:44:58AM -0400, Bruce Momjian wrote: > Simon Riggs wrote: > > On Thu, 2010-07-15 at 15:38 -0400, Bruce Momjian wrote: > > > > > I assume SHOW TABLES would only be useful for interactive terminal > > > sesssions, not for application code (which should use > > > information

Re: [HACKERS] SHOW TABLES

2010-07-16 Thread Bruce Momjian
Simon Riggs wrote: > On Thu, 2010-07-15 at 15:38 -0400, Bruce Momjian wrote: > > > I assume SHOW TABLES would only be useful for interactive terminal > > sesssions, not for application code (which should use > > information_schema), so what non-psql interactive terminal programs > > are there? >

Re: [HACKERS] SHOW TABLES

2010-07-16 Thread Simon Riggs
On Thu, 2010-07-15 at 15:38 -0400, Bruce Momjian wrote: > I assume SHOW TABLES would only be useful for interactive terminal > sesssions, not for application code (which should use > information_schema), so what non-psql interactive terminal programs > are there? My original thought was around th

Re: [HACKERS] SHOW TABLES

2010-07-16 Thread Steve Atkins
On Jul 16, 2010, at 8:11 AM, Simon Riggs wrote: > On Fri, 2010-07-16 at 14:07 +0100, Thom Brown wrote: > >> The problem is people are stating different requirements. >> >> - to make it easy for new users of psql >> - to simplify fetching basic database information from any client application >>

Re: [HACKERS] SHOW TABLES

2010-07-16 Thread Simon Riggs
On Fri, 2010-07-16 at 14:07 +0100, Thom Brown wrote: > The problem is people are stating different requirements. > > - to make it easy for new users of psql > - to simplify fetching basic database information from any client application > - to ease transition between MySQL and PostgreSQL Close,

Re: [HACKERS] SHOW TABLES

2010-07-16 Thread Thom Brown
On 16 July 2010 13:49, Bruce Momjian wrote: > Bruce Momjian wrote: >> Andrew Dunstan wrote: >> > >> > >> > Bruce Momjian wrote: >> > > I assume SHOW TABLES would only be useful for interactive terminal >> > > sesssions, not for application code (which should use >> > > information_schema), so what

Re: [HACKERS] SHOW TABLES

2010-07-16 Thread Pavel Stehule
2010/7/16 Bruce Momjian : > Andrew Dunstan wrote: >> >> >> Bruce Momjian wrote: >> > I assume SHOW TABLES would only be useful for interactive terminal >> > sesssions, not for application code (which should use >> > information_schema), so what non-psql interactive terminal programs are >> > there?

Re: [HACKERS] SHOW TABLES

2010-07-16 Thread Bruce Momjian
Bruce Momjian wrote: > Andrew Dunstan wrote: > > > > > > Bruce Momjian wrote: > > > I assume SHOW TABLES would only be useful for interactive terminal > > > sesssions, not for application code (which should use > > > information_schema), so what non-psql interactive terminal programs are > > > th

Re: [HACKERS] SHOW TABLES

2010-07-16 Thread Bruce Momjian
Andrew Dunstan wrote: > > > Bruce Momjian wrote: > > I assume SHOW TABLES would only be useful for interactive terminal > > sesssions, not for application code (which should use > > information_schema), so what non-psql interactive terminal programs are > > there? > > > > > > I think your ass

Re: [HACKERS] SHOW TABLES

2010-07-16 Thread Markus Wanner
> I have to agree with Simon here. \d is ridiculous for the common user. +1 Regards Markus -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers

Re: [HACKERS] SHOW TABLES

2010-07-16 Thread Robert Haas
On Jul 15, 2010, at 11:18 PM, Josh Berkus wrote: > I think it's very important, as Haas says, to consider that whatever we > do in this arena, we'll be living with it forever, so let's not make the > \dv vs. \df mistake again, ok? Refresh my memory? ...Robert -- Sent via pgsql-hackers mailing

Re: [HACKERS] SHOW TABLES

2010-07-16 Thread Hans-Jürgen Schönig
On Jul 15, 2010, at 6:43 PM, Magnus Hagander wrote: > On Thu, Jul 15, 2010 at 18:35, Simon Riggs wrote: >> On Thu, 2010-07-15 at 17:38 +0200, Magnus Hagander wrote: >> >>> Is there an actual common use-case for having these commands available >>> for *non-psql* interfaces? >> >> There are many

Re: [HACKERS] SHOW TABLES

2010-07-16 Thread Simon Riggs
On Thu, 2010-07-15 at 21:57 -0400, Robert Haas wrote: > Exactly which commands are we going to support? With exactly what > syntax? What information will be returned by each command? In what > format? We have no agreement on any of these points. The normal process is that we discuss the requi

Re: [HACKERS] SHOW TABLES

2010-07-15 Thread Josh Berkus
All, So, from my perspective is that the main issue with the \d commands is that they are not accessible from interfaces other than psql. Often, you have to write a big, hairy, pg-version-specific query to make them happen. information_schema is nice but (a) it's not in the default search path,

Re: [HACKERS] SHOW TABLES

2010-07-15 Thread Marc G. Fournier
On Thu, 15 Jul 2010, Simon Riggs wrote: On Thu, 2010-07-15 at 13:44 -0500, Robert Haas wrote: That seems rather wretched for machine-parsability, which I think is an important property for anything we do in this area. I completely disagree. This is for humans only, and mostly newbies only. A

Re: [HACKERS] SHOW TABLES

2010-07-15 Thread Robert Haas
On Thu, Jul 15, 2010 at 5:34 PM, Simon Riggs wrote: > On Thu, 2010-07-15 at 13:44 -0500, Robert Haas wrote: >> Sounds good, but we need agreement on a more detailed design first. > What do you mean? Exactly which commands are we going to support? With exactly what syntax? What information will

Re: [HACKERS] SHOW TABLES

2010-07-15 Thread Alvaro Herrera
Excerpts from David Fetter's message of jue jul 15 19:19:47 -0400 2010: > On Thu, Jul 15, 2010 at 02:31:10PM -0400, Alvaro Herrera wrote: > > Or even > > > > TABLE TABLES; > > > > weird though that is ... > > "Weird though that is," is *exactly* the problem we're trying to > address here. SHOW

Re: [HACKERS] SHOW TABLES

2010-07-15 Thread David Fetter
On Thu, Jul 15, 2010 at 02:31:10PM -0400, Alvaro Herrera wrote: > Excerpts from Peter Eisentraut's message of jue jul 15 14:21:26 -0400 2010: > > On tor, 2010-07-15 at 17:35 +0100, Simon Riggs wrote: > > > There should be one command to "display a list of tables" and it needs > > > to be easily gue

Re: [HACKERS] SHOW TABLES

2010-07-15 Thread Dimitri Fontaine
Le 15 juil. 2010 à 18:43, Magnus Hagander a écrit : > The downside is that you are then limited to what can be returned as a > resultset. A "\d table" in psql returns a hell of a lot more than > that. So do we keep two separate formats for this? Or do we remove the > current, useful, output format

Re: [HACKERS] SHOW TABLES

2010-07-15 Thread Simon Riggs
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 regularl

Re: [HACKERS] SHOW TABLES

2010-07-15 Thread Simon Riggs
On Thu, 2010-07-15 at 13:44 -0500, Robert Haas wrote: > That seems rather wretched for machine-parsability, which I think is > an important property for anything we do in this area. I completely disagree. This is for humans only, and mostly newbies only. Anybody that wants structured output can t

Re: [HACKERS] SHOW TABLES

2010-07-15 Thread Robert Haas
On Jul 15, 2010, at 2:26 PM, Richard Huxton wrote: > 3. Add "SHOW xxx" and have it return a single query > Have it also issue "NOTICE: from psql, try \dt for more info" A big -1 from me on that. Going to a whole lot of trouble to implement something half as functional as what we have already

Re: [HACKERS] SHOW TABLES

2010-07-15 Thread Simon Riggs
On Thu, 2010-07-15 at 13:44 -0500, Robert Haas wrote: > Sounds good, but we need agreement on a more detailed design first. What do you mean? -- Simon Riggs www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Training and Services -- Sent via pgsql-hackers mailing list (pgs

Re: [HACKERS] SHOW TABLES

2010-07-15 Thread Ross J. Reedstrom
On Thu, Jul 15, 2010 at 04:20:12PM +0100, Simon Riggs wrote: > > Just for the record, I've never ever met anyone that said "Oh, this \d > syntax makes so much sense. I'm a real convert to Postgres now you've > shown me this". The reaction is always the opposite one; always > negative. Which detrac

Re: [HACKERS] SHOW TABLES

2010-07-15 Thread David Christensen
On Jul 15, 2010, at 2:45 PM, Heikki Linnakangas wrote: > On 15/07/10 19:06, Aaron W. Swenson wrote: >> The best solution is to offer a hint to the user in psql when they submit >> 'SHOW . . . .' with a response like: SHOW . . . . is not a valid command. >> Perhaps you mean \d . . . . > > +1. Tha

Re: [HACKERS] SHOW TABLES

2010-07-15 Thread Richard Huxton
On 15/07/10 20:43, Greg Sabino Mullane wrote: -BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 I was assuming the process would be something like: 1. Move existing \d queries into functions* 2. Convert psql to use those Oops! There's goes your ability to handle older versions of Postgres f

Re: [HACKERS] SHOW TABLES

2010-07-15 Thread Bernd Helmle
--On 15. Juli 2010 15:52:24 -0400 Andrew Dunstan wrote: 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 Yeah, something like this was

Re: [HACKERS] SHOW TABLES

2010-07-15 Thread Andrew Dunstan
Bruce Momjian wrote: I assume SHOW TABLES would only be useful for interactive terminal sesssions, not for application code (which should use information_schema), so what non-psql interactive terminal programs are there? I think your assumption is questionable. Plenty of people use MySQL

Re: [HACKERS] SHOW TABLES

2010-07-15 Thread Heikki Linnakangas
On 15/07/10 19:06, Aaron W. Swenson wrote: The best solution is to offer a hint to the user in psql when they submit 'SHOW . . . .' with a response like: SHOW . . . . is not a valid command. Perhaps you mean \d . . . . +1. That doesn't force us to implement a whole new set of commands and synt

  1   2   >