Re: Retrieving a list of tables

From: "Papp Gyozo" <pgerzson(at)freestart(dot)hu>
To: "David C(dot) Brown" <dbrown(at)centennialwines(dot)com>
Cc: <pgsql-php(at)postgresql(dot)org>
Subject: Re: Retrieving a list of tables
Date: 2001-10-18 10:43:54
Message-ID: 001401c157c2$0898fb40$01fdfea9@jaguar
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-php

If you runs psql with -E option, then psql reveals the SQL equivalent of its
magical metacommands starting with a backslash ie.: \dv \d and so on. Use
those queries !

<manual src="app-psql.html">
-E, --echo-hidden
Echoes the actual queries generated by \d and other backslash commands. You
can use this if you wish to include similar functionality into your own
programs. This is equivalent to setting the variable ECHO_HIDDEN from within
psql.
</manual>

----- Original Message -----
From: <erle(at)hindang(dot)msuiit(dot)edu(dot)ph>
To: "David C. Brown" <dbrown(at)centennialwines(dot)com>
Cc: <pgsql-php(at)postgresql(dot)org>
Sent: Wednesday, October 17, 2001 10:59 PM
Subject: Re: [PHP] Retrieving a list of tables

> On Tue, 16 Oct 2001, David C. Brown wrote:
>
> > Heyas,
> >
> > I need to be able to get a list of the tables from a postgresql from
> > php. I'm
> > porting a php-mysql website over to postgresql. I have a form that
> > populates
> > a <SELECT> statment with the tables in the db.
> >
> > In Mysql I just used the sql query "SHOW TABLES;" postgresql doesn't
> > support that sql statment, and pg-php doesn't like me sending a "\d" as
> > a
> > query.
> >
> > Anyone have any help, or ideas how I may be able to work around this?
> > or is there a query for pg-sql that I don't know about?
> >
> > Any and all help would be great... Thanx
> >
> > Dave
> >
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 4: Don't 'kill -9' the postmaster
> >
>
> Hey ,....
>
>
> If you want to know the list of tables in a certain database,
> you can query the pg_table table.
>
> select * from pg_tables where tableowner = 'ME';
>
> Its not really a table but a view, it contains all the tables in a
> database where you connected including the system tables of postgres so be
> sure to filter your query.
>
> Let me know if this was what you need ....
>
>
> Erle Czar S. Mantos
> erle(at)hindang(dot)msuiit(dot)edu(dot)ph
>
> ---------- MARTIANS LAIR ---------
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly

In response to

Browse pgsql-php by date

  From Date Subject
Next Message Gurudutt 2001-10-19 08:09:19 Can't postgres join tables on varchar fields ? <EOM>
Previous Message erle 2001-10-17 20:59:34 Re: Retrieving a list of tables