Re: [GENERAL] How to get table/DB info

From: "Ross J(dot) Reedstrom" <reedstrm(at)wallace(dot)ece(dot)rice(dot)edu>
To: Jeff Davis <jeff95350(at)yahoo(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: [GENERAL] How to get table/DB info
Date: 2000-03-05 04:08:42
Message-ID: 20000304220842.A31146@rice.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sat, Mar 04, 2000 at 05:47:22PM -0800, Jeff Davis wrote:
> This is a follow up to my previous question about this
> subject.
>

Jeff -
Sorry no-one replied to your earlier messsage: have you looked
at the -E switch to psql? It'll echo all the queries sent to the
backend, so to find out how \d tablename works, just do:

psql -E test
...

test=> \d no_such_table
QUERY: SELECT a.attnum, a.attname, t.typname, a.attlen, a.atttypmod,
a.attnotnull, a.atthasdef FROM pg_class c, pg_attribute a, pg_type t
WHERE c.relname = 'no_such_table' and a.attnum > 0 and a.attrelid =
c.oid and a.atttypid = t.oid ORDER BY attnum

Couldn't find table no_such_table!
test=>

And so on. You might want to use 'transcript' to grab a copy of your
entire session (I think that'll work) and do a bunch of \d commands that
you're interested in.

Ross
--
Ross J. Reedstrom, Ph.D., <reedstrm(at)rice(dot)edu>
NSBRI Research Scientist/Programmer
Computer and Information Technology Institute
Rice University, 6100 S. Main St., Houston, TX 77005

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Stan Jacobs 2000-03-05 04:47:41 Re: [GENERAL] Simple problem?
Previous Message Ed Loehr 2000-03-05 03:35:39 Re: [GENERAL] RE: Help with installing 6.5.3 on RedHat6.1 - specifying template