Thread: tablemeta-data

tablemeta-data

From
Erik Price
Date:
Hi,

Is there a way to execute a query that returns meta-data about the
tables?  Specifically I am interested in a psql command to display
information about a table's column names and types.

I have moved from MySQL to PostgreSQL to expand my horizons but the SHOW
DATABASES and DESCRIBE some_table commands are the ones I find myself
missing the most.  Perhaps there's some SQL that approximates it.

Thanks,

Erik


Re: tablemeta-data

From
Bruno Wolff III
Date:
On Thu, May 22, 2003 at 12:58:21 -0400,
  Erik Price <eprice@ptc.com> wrote:
> Hi,
>
> Is there a way to execute a query that returns meta-data about the
> tables?  Specifically I am interested in a psql command to display
> information about a table's column names and types.

\d table_name

Use \? to get a list of \ commands.

Re: tablemeta-data

From
"Jim C. Nasby"
Date:
Have you tried \l and \d in psql?

See also
http://www.postgresql.org/docs/view.php?version=7.3&idoc=0&file=catalogs.html

On Thu, May 22, 2003 at 12:58:21PM -0400, Erik Price wrote:
> Hi,
>
> Is there a way to execute a query that returns meta-data about the
> tables?  Specifically I am interested in a psql command to display
> information about a table's column names and types.
>
> I have moved from MySQL to PostgreSQL to expand my horizons but the SHOW
> DATABASES and DESCRIBE some_table commands are the ones I find myself
> missing the most.  Perhaps there's some SQL that approximates it.
>
> Thanks,
>
> Erik
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org
>

--
Jim C. Nasby (aka Decibel!)                    jim@nasby.net
Member: Triangle Fraternity, Sports Car Club of America
Give your computer some brain candy! www.distributed.net Team #1828

Windows: "Where do you want to go today?"
Linux: "Where do you want to go tomorrow?"
FreeBSD: "Are you guys coming, or what?"

Re: tablemeta-data

From
Erik Price
Date:

Bruno Wolff III wrote:
> On Thu, May 22, 2003 at 12:58:21 -0400,
>   Erik Price <eprice@ptc.com> wrote:
>
>>Hi,
>>
>>Is there a way to execute a query that returns meta-data about the
>>tables?  Specifically I am interested in a psql command to display
>>information about a table's column names and types.
>
>
> \d table_name
>
> Use \? to get a list of \ commands.

Thanks everyone for these commands.  I thought I had read through the
options in "\?" but guess I didn't look too closely.  This is exactly
what I was looking for.


Regards,

Erik