Re: DESC

From: Rynell Wesson <rwesson(at)cs(dot)utexas(dot)edu>
To: Mike Castle <dalgoda(at)ix(dot)netcom(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: DESC
Date: 2000-11-22 22:51:28
Message-ID: Pine.LNX.4.21.0011221611480.20947-100000@isle-of-jura.cs.utexas.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

See comments below.

On Wed, 22 Nov 2000, Mike Castle wrote:

> On Wed, Nov 22, 2000 at 06:38:15PM +0100, Albert REINER wrote:
> > And if you start psql with option -E you will see the actual
> > SQL-queries used by \d.
>
> That's nifty. I've read through all of the pgsql documentation before
> starting everything, but I think I'm suffering a bit from information
> overload. I knew this information was somewhere, I just couldn't remember
> where.
>
> So, thanks to all who pointed me to \d.
>
> Ok then. It looks to me like both "DESC" and "DESCRIBE" are SQL keywords.
> DESC apparently is meant for descending, so I'm guessing that Oracle's
> sqlplus usage of DESC is an extension. Is that correct?

DESC and ASC are SQL keywords used with the ORDER BY keywords for
listing values in descending and ascending order,
respectively. DESC(RIBE) within an Oracle sqlplus session does not
conflict with the SQL DESC keyword. DESC when used within an sqlplus
session will display a specified table's definition. One version of
DESC is used within SQL DML statements, like SELECT <statement>, and the
other is used as a utility within an sqlplus session, just like any
utility found within a Unix shell (e.g. ls, find, echo, etc.).

>
> If so, is "DESCRIBE" the ANSI command that should do what \d does or does
> it serve another purpose in ANSI? (A pointer as to where to find this
> explicitly would be nice; will eventually purchase the standard myself).
>

This version of DESCRIBE is for use within embedded SQL programs (C/C++).
More specifically, it is used with dynamic SQL select statements within
embedded SQL programs and it must be used after the dynamic SQL statement
has been compiled using the PREPARE statement.

> If DESCRIBE is supposed to do that, is there any reason that pgsql doesn't
> do that outside of "\d works, so no one has bothered to implement it."
>

I haven't written any embedded SQL programs using the traditional EXEC SQL
formats (I usually use libpq/libpq++ or JDBC) within PostgreSQL, but
PostgreSQL should be able to handle the DESCRIBE statement within embedded
SQL programs if it adhered to the embedded SQL specfications for C
utilizing EXEC SQL syntax.

I hope that I interpreted your questions correctly and I haven't stated
too much or too little in answering them and that all of this will give
you a better understanding.

Thanks.

Rynell Wesson

In response to

  • Re: DESC at 2000-11-22 18:54:12 from Mike Castle

Browse pgsql-novice by date

  From Date Subject
Next Message GH 2000-11-23 03:10:55 PHP and persistent connections
Previous Message Kiss Zoltán 2000-11-22 21:00:21 nowait