Thread: how to examin the database structure with an sql command

how to examin the database structure with an sql command

From
Hans Jeuken
Date:
I am busy writing a table editor in Perl, using the module Pg.pm as
interface to Postgresql. When opening a table in that editor I would like
to find out how the tables in the database are defined.

So far I have considered doing a pg_dump to a file and then examine the
content, but it is so unelegant.

then I have considered the query "SELECT  * FROM pga_layout". Problem here
is that the table pga_layout only not defined when the database has no
tuples yet.

Who is able to give me the big hint here?


Re: how to examin the database structure with an sql command

From
will trillich
Date:
On Tue, Feb 27, 2001 at 05:11:07PM +0100, Hans Jeuken wrote:
>
> I am busy writing a table editor in Perl, using the module Pg.pm as
> interface to Postgresql. When opening a table in that editor I would like
> to find out how the tables in the database are defined.
>
> So far I have considered doing a pg_dump to a file and then examine the
> content, but it is so unelegant.
>
> then I have considered the query "SELECT  * FROM pga_layout". Problem here
> is that the table pga_layout only not defined when the database has no
> tuples yet.
>
> Who is able to give me the big hint here?

those pga_* tables are created by PGACCESS, which is a
nearly-ready-for-prime-time xwindows postgresql interface.

two options: peruse the tcl code of pgaccess to see how they do
it, or wait for some guru here to reveal the inner secrets you
seek...

--
It is always hazardous to ask "Why?" in science, but it is often
interesting to do so just the same.
        -- Isaac Asimov, 'The Genetic Code'

will@serensoft.com
http://groups.yahoo.com/group/newbieDoc -- we need your brain!
http://www.dontUthink.com/ -- your brain needs us!