From: | Andreas Scherbaum <adsmail(at)htl(dot)de> |
---|---|
To: | Postgres General List <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: Porting from MySql - meta data issues |
Date: | 2002-04-05 13:40:18 |
Message-ID: | 3CADA942.487A0675@htl.de |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Geoff Caplan wrote:
> I'm porting quite a big PHP application from MySql and have hit an issue.
>
> I have a number of PHP functions in the app which return meta-info about
> the data structure:
brave new SQL, once created for database independence... ;-)
> With MySql, this info is readily available using the various SHOW queries,
> but I can't figure out how to do this with Postgres.
>
> The only option I have come up with is to shell out to psql, run \l and \d
> commands, and use a regex to parse the strings returned. Clearly, this
> would be a bit of a hack, and not resource efficient.
start psql with the -E option (see the manpage). This will display all
queries,
which the psql tool does send to the backend.
You can fetch all kind of informations you need from the pg_* tables.
Best regards
--
Andreas 'ads' Scherbaum
From | Date | Subject | |
---|---|---|---|
Next Message | Heiko Klein | 2002-04-05 14:12:36 | triggering a sequence |
Previous Message | Martín Marqués | 2002-04-05 11:01:05 | Re: binary data storage |