Re: psql \d option list overloaded

From: Rod Taylor <pg(at)rbt(dot)ca>
To: "D(dot) Dante Lorenso" <dante(at)lorenso(dot)com>
Cc: "Alex J(dot) Avriette" <alex(at)posixnap(dot)net>, Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: psql \d option list overloaded
Date: 2004-01-09 03:27:28
Message-ID: 1073618847.322.29.camel@jester
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-advocacy pgsql-general 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.

In response to

Browse pgsql-advocacy by date

  From Date Subject
Next Message Christopher Browne 2004-01-09 03:45:10 Re: Will Open Source be forced to go Proprietary
Previous Message Marc G. Fournier 2004-01-09 01:27:40 Re: Will Open Source be forced to go Proprietary

Browse pgsql-general by date

  From Date Subject
Next Message Michael Glaesemann 2004-01-09 03:32:38 Re: start/stop a database
Previous Message Doug McNaught 2004-01-09 03:22:59 Re: Backend start-up failed FATAL : non-superuser

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruno Wolff III 2004-01-09 04:10:35 Re: Restrict users from describing table
Previous Message Tom Lane 2004-01-09 00:10:07 Re: RFC: bufmgr locking changes