Re: psql \d option list overloaded - Mailing list pgsql-hackers

From Rod Taylor
Subject Re: psql \d option list overloaded
Date
Msg-id 1073618847.322.29.camel@jester
Whole thread Raw
In response to Re: psql \d option list overloaded  ("D. Dante Lorenso" <dante@lorenso.com>)
List pgsql-hackers
> Anything other than simple, short commands is a waste, IMHO.  I can easily
> remember SHOW DATABASES and SHOW TABLES and DESC <table>, because they 
> reflect
> my intensions directly and 'make sense'.

Can you remember how to get a list of indexes on a particular table? How
about a specific indexes build? I ask, because I constantly forgot both
of those (don't like FROM).

> 2) (using information schema ... little better)
> 
>     SELECT table_name FROM information_schema.tables WHERE table_schema 
> = 'public';
> 
> or ...
> 
> 3) like MySQL does it...
> 
>     SHOW TABLES;
> 
> Lemme think about which one I prefer ;-) Uh, Ok, I'm done thinking
> now. hehe.

I actually prefer #2 myself. It works on a number of databases aside
from just PostgreSQL. So, as a user who worked in a mixed environment it
was easier to remember.

But I get your point.

> Sure, with time as my database needs grew and I matured as a developer,
> I eventually gained more respect for PostgreSQL and have made the switch
> even without this feature, but to this day, I really think MySQL *did it
> right* with those extensions.  You can't become a PostgreSQL guru without

I agree with the simple SHOW TABLES command but disagree with:

SHOW [FULL] COLUMNS FROM tbl_name [FROM db_name] [LIKE wild]

I much prefer:

SELECT * FROM COLUMNS WHERE table LIKE '%tab%' AND database = 'billing';

It's not much longer, certainly more natural to those that know SQL, and
infinitely more useful since you can create result sets that the
programmer of SHOW hadn't considered. A perfect example is the addition
of the FULL clause in SHOW. The above select does not need additional
keywords for different formatting options as it can simply use "natural"
SQL styling.



pgsql-hackers by date:

Previous
From: Michael Gill
Date:
Subject: Re: Restrict users from describing table
Next
From: Bruno Wolff III
Date:
Subject: Re: Restrict users from describing table