Re: Porting from MySql - meta data issues
| От | Andreas Scherbaum |
|---|---|
| Тема | Re: Porting from MySql - meta data issues |
| Дата | |
| Msg-id | 3CADA942.487A0675@htl.de обсуждение исходный текст |
| Ответ на | Porting from MySql - meta data issues (Geoff Caplan <geoff@advantae.com>) |
| Список | 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
В списке pgsql-general по дате отправления: