Re: psql \d option list overloaded

From: "Alex J(dot) Avriette" <alex(at)posixnap(dot)net>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: "D(dot) Dante Lorenso" <dante(at)lorenso(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: psql \d option list overloaded
Date: 2004-01-04 19:13:22
Message-ID: 20040104191322.GD8524@posixnap.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-advocacy pgsql-general pgsql-hackers

On Sat, Jan 03, 2004 at 08:25:21PM -0500, Bruce Momjian wrote:

> > I finally figure it out, I just end up forgetting again later. I still
> > have no clue how I'd find the same data without using psql. In MySQL
> > I can run those queries from PHP, PERL...etc. I know you can find that
> > data in system tables in PostgreSQL, but I don't wanna muck around with
> > all that. I just wanna do something as simple as MySQL.
>
> [ Moved to hackers.]
>
> I am starting to agree that our \d* handling is just too overloaded.
> Look at the option list from \?:

> I like the idea of adding a new syntax to show that information using
> simple SQL command syntax, and putting it in the backend so all
> applications can access it. I know we have information schema, and
> maybe that can be used to make this simpler.

Bruce, while I agree with you about \d (and all its children), as well
as the querying we talked about on irc, I disagree with the notion of a
"SHOW DATABASES" query. This is one of the things that irritates me
about mysql is the pseudo-sql that everyone has come to accept (through
learning sql on mysql) as "sql". Things such as the '#' comments, and
the various SHOW DATABASES, I feel, detract from the "look and feel" of
the database. That look and feel is one of the reasons I am so loyal to
postgres (and indeed why some people are so loyal to mysql).

It doesn't make sense to create pseudo-sql, when all you're abstracting
is function-macros. I think the backslash syntax is fine. If you really
wanted to change it, you might consider a different syntax for it. Many
of us are familiar with slash/bang/colon/backslash commands in
interfacing with the programs we use regularly (vi, shells, irc
clients). Why not a /functions as a long syntax for \df? Would there be
a direct problem using the forward slash as a command indicator? This
way you could give people like the original poster something they were
looking for, eg:

/functions
/databases

and what I was looking for:

/functions timestamp

It also allows us a lot more freedom in changing the syntax, as the
expression of the commands is english (or, pick your language). I seem
to recall Neil mentioning to me that was a problem with
internationalization, but that's over my head.

I don't have any particular allegiance to the forward slash over anything
else. My chief concern is that what we're abstracting here are macros, and
as such, they should not be treated as sql. Because they aren't sql. If
you want to find out how to show the databases in sql, use psql -E.

Alex

--
alex(at)posixnap(dot)net
Alex J. Avriette, Solaris Systems Masseur
"I ... remain against the death penalty because I feel that eternal boredom with no hope of parole is a much worse punishment than just ending it all mercifully with that quiet needle." - Rachel Mills, NC Libertarian Gubernatorial Candidate

In response to

Responses

Browse pgsql-advocacy by date

  From Date Subject
Next Message Paul Ganainm 2004-01-04 21:46:58 Re: Is my MySQL Gaining ?
Previous Message Peter Eisentraut 2004-01-04 18:53:36 Re: psql \d option list overloaded

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2004-01-04 19:26:57 Re: GetLastInsertID ?
Previous Message A E 2004-01-04 19:06:07 Anything akin to an Evaluate Statement in Postgresql?

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Sabino Mullane 2004-01-04 19:44:35 Adding "help" to psql
Previous Message Peter Eisentraut 2004-01-04 18:53:36 Re: psql \d option list overloaded