Re: SHOW

From: Doug McNaught <doug(at)wireboard(dot)com>
To: sb(at)ows(dot)es
Cc: Joe Conway <joseph(dot)conway(at)home(dot)com>, bpalmer <bpalmer(at)crimelabs(dot)net>, pgsql-general(at)postgresql(dot)org
Subject: Re: SHOW
Date: 2001-09-04 14:35:07
Message-ID: m3g0a3owh0.fsf@belphigor.mcnaught.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Stephan Bergmann <sb(at)ows(dot)es> writes:

> Hi Joe.
>
> >
> > Start up psql with the -E on the command line. Then do \d TABLE. This will
> > show you the actual SQL commands used by psql.
>
> Doesn't change nothing.

Hmm, works for me. What version of Postgres are you using?

Example:

[doug(at)scooby doug]$ psql -E template1
********* QUERY *********
SELECT usesuper FROM pg_user WHERE usename = 'doug'
*************************

Welcome to psql, the PostgreSQL interactive terminal.

Type: \copyright for distribution terms
\h for help with SQL commands
\? for help on internal slash commands
\g or terminate with semicolon to execute query
\q to quit

template1=# \d
********* QUERY *********
SELECT c.relname as "Name", 'table'::text as "Type", u.usename as "Owner"
FROM pg_class c, pg_user u
WHERE c.relowner = u.usesysid AND c.relkind = 'r'
AND c.relname !~ '^pg_'
UNION
SELECT c.relname as "Name", 'table'::text as "Type", NULL as "Owner"
FROM pg_class c
WHERE c.relkind = 'r'
AND not exists (select 1 from pg_user where usesysid = c.relowner)
AND c.relname !~ '^pg_'

UNION

[more query here...]

--
Free Dmitry Sklyarov!
http://www.freesklyarov.org/

We will return to our regularly scheduled signature shortly.

In response to

  • Re: SHOW at 2001-09-04 07:25:57 from Stephan Bergmann

Responses

  • Re: SHOW at 2001-09-04 14:46:23 from Stephan Bergmann
  • Re: SHOW at 2001-09-04 19:12:17 from bpalmer

Browse pgsql-general by date

  From Date Subject
Next Message Stephan Bergmann 2001-09-04 14:46:23 Re: SHOW
Previous Message Tom Lane 2001-09-04 14:33:20 Re: how do functional indices work?